with the intent of finding errors. ... This definition of testing has many implications ... it implies that testing is a destructive process, even a sadistic process, which explains why most people find it difficult.” Glenford J. Myers
DummyMemory(); } public class DummyMemory implements Memory { @Override public void put(int value, int position) { } @Override public int get(int memoryPosition) { return 0; } }
numCalls; private int argument; @Override public void write(int value) { numCalls ++; argument = value; } public int getNumCalls() {return numCalls;} public int getArgumentCatcher() {return argument;} }
values = new ArrayList<Integer>(); @Override public void put(int value, int position) { values.add(value); } @Override public int get(int memoryPosition) { return 0;} public List<Integer> getValues() { return values; } }
{ Map<Integer, Integer> mem = new HashMap<Integer, Integer>(); @Override public void put(int value, int position) { mem.put(position, value); } @Override public int get(int memoryPosition) { return mem.get(memoryPosition); } }
Unit Testing. Pablo Guardiola Working Effectively with Unit testing. Jay Fields Software Craftmanship. Sandro Mancuso Mocks Aren't Stubs. martin fowler. 2007 Software Reliability: Principles & Practices. Glenford J. Myers 1976 The Art of Unit Testing. Roy Osherove Test Driven Development: By Example. Kent Beck