Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #13 from peterrhysthomas/master

Added README and some small naming changes
  • Loading branch information...
commit bcad52d3bae0b67c8073168550dbce145ec5d2d3 2 parents 599e6d4 + de72de5
@lucaminudel authored
View
3  TDDMicroExercises.YoursSolutions/Java-peterrhysthomas/README.md
@@ -0,0 +1,3 @@
+## Solution from [@peterrhysthomas](https://twitter.com/peterrhysthomas)
+
+Note - this solution uses the [characterization testing](http://en.wikipedia.org/wiki/Characterization_test) approach for placing the code under test before implementing any refactoring of the solution. These tests act as a regression to ensure that the existing behaviour is maintained through the subsequent refactoring and unit testing cycle. Characterization tests are based on the existing inputs and outputs of the code and it makes no attempt to check the validity of these, it assumes that the existing behaviour is the desired behaviour.
View
2  TDDMicroExercises.YoursSolutions/Java-peterrhysthomas/TelemetrySystem/pom.xml
@@ -12,4 +12,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-</project>
+</project>
View
9 ...em/TelemetryDiagnosticControlsCoveringsTests.java → ...metryDiagnosticControlsCharacterizationTests.java
@@ -3,10 +3,13 @@
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
-
-public class TelemetryDiagnosticControlsCoveringsTests{
+/**
+ * Characterization test class for testing existing behaviour of
+ * {@link TelemetryDiagnosticControls} before refactoring.
+ *
+ */
+public class TelemetryDiagnosticControlsCharacterizationTests{
@Test
- // Regression test to ensure existing API is not broken
public void checkTransmissionShouldSetDiagnosticInfo() throws Exception{
TelemetryDiagnosticControls controls = new TelemetryDiagnosticControls();
View
8 ...UnicodeFileToHtmlTextConverterCoveringsTests.java → ...FileToHtmlTextConverterCharacterizationTests.java
@@ -6,10 +6,14 @@
import org.junit.Test;
-public class UnicodeFileToHtmlTextConverterCoveringsTests {
+/**
+ * Characterization test class for testing existing behaviour of
+ * {@link UnicodeFileToHtmlTextConverter} before refactoring.
+ *
+ */
+public class UnicodeFileToHtmlTextConverterCharacterizationTests {
@Test
- // Regression test to ensure existing API is not broken
public void shouldConvertFileContentsToHtmlEscapedString() throws IOException {
String fullFilenameWithPath = this.getClass().getClassLoader().getResource("data.txt").getPath();
UnicodeFileToHtmlTextConverter converter = new UnicodeFileToHtmlTextConverter(fullFilenameWithPath);
View
9 ...tdispenser/TurnTicketDispenserCoveringsTests.java → ...ser/TurnTicketDispenserCharacterizationTests.java
@@ -4,11 +4,14 @@
import org.junit.Test;
-
-public class TurnTicketDispenserCoveringsTests {
+/**
+ * Characterization test class for testing existing behaviour of
+ * {@link TicketDispenser} before refactoring.
+ *
+ */
+public class TurnTicketDispenserCharacterizationTests {
@Test
- // Regression test to ensure existing API is not broken
public void returnsAnIncrementingSequenceOfTicketsUsingDefaultSequenceImplementation() {
TicketDispenser dispenser = new TicketDispenser();
assertEquals(0,dispenser.getTurnTicket().getTurnNumber());
Please sign in to comment.
Something went wrong with that request. Please try again.