Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added README and some small naming changes #13

Merged
merged 3 commits into from

2 participants

@peterrhysthomas

Hi, I have added a README to explain the approach of adding a Characterization test to ensure that the refactoring doesnt regress the existing behaviour.

@lucaminudel lucaminudel merged commit bcad52d into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 10, 2012
  1. @peterrhysthomas

    Changed pom

    peterrhysthomas authored
  2. @peterrhysthomas
  3. @peterrhysthomas

    Added README and also changed file names for test to CharaterizationT…

    peterrhysthomas authored
    …ests to meet the convention from Michael Feathers
This page is out of date. Refresh to see the latest.
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());
Something went wrong with that request. Please try again.