ABSTRACT

This chapter introduces test-driven development (TDD) as a method of machine ethics. Key elements of TDD as applied to machine ethics include clear delineation of scope, an incremental approach that is as simple as possible, ‘stubbing’ the technically impossible and the stipulation of moral knowledge. To begin with, controversial test cases are not stipulated; rather, knowledge representation and reasoning (KR&R) needed to solve ‘morally obvious’ problems is developed first. This KR&R is then applied to more difficult moral problems. Test-driven development as a method of machine ethics can be seen as an AI adaptation of traditional philosophical methods such as Rawlsian reflective equilibrium and Socratic dialectic. In essence, it is simply an application of the software development method of TDD to the solution of ethical problems in AI.