diff --git a/README.md b/README.md index 6702bc9..8f4e36a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,19 @@ # golden-master -A harness for writing [Golden Master tests](https://dzone.com/articles/testing-legacy-code-golden) in Java +A harness for easy writing of [Golden Master tests](https://dzone.com/articles/testing-legacy-code-golden) in Java. Follow the JitPack button below in order to include it in your project. [![](https://jitpack.io/v/maxbechtold/golden-master.svg)](https://jitpack.io/#maxbechtold/golden-master) [![Build Status](https://travis-ci.org/maxbechtold/golden-master.svg?branch=master)](https://travis-ci.org/maxbechtold/golden-master) -## Requirements -Java 8 +## Benefits + +* No cumbersome boilerplate code - focus on your program instrumentation +* Built-in repetitions - easily verify 10, 100, or 10,000 program inputs +* IDE integration - continuous visual feedback -## How to use (preliminary explanation) +![screenshot](src/main/resources/docs/ide-support.PNG) -You basically implement a [JUnit 5 templated test](http://junit.org/junit5/docs/current/user-guide/#writing-tests-test-templates) like so (check out ``ExampleGoldenMasterTest`` for a more detailed example): +## How to use (basic explanation) + +You basically implement a [JUnit 5 templated test](http://junit.org/junit5/docs/current/user-guide/#writing-tests-test-templates) like so (check out [ExampleGoldenMasterTest](src/test/java/maxbe/goldenmaster/example/ExampleGoldenMasterTest.java) for a more detailed example): ```java @GoldenMasterTest @@ -26,8 +31,14 @@ public class ATest { } ``` -When you run your test for the first time, the outputs will serve as the initial *master files*. You are asked to *approve* the previous outputs by manually executing a generated script file. +When you run your test for the first time, the outputs will serve as the initial *master files*. You are asked to *approve* the previous outputs by running the tests again and then manually executing a generated script file*. Every successive test run will then be matched against those master files - and fail if there are changes (e.g. due to mistakes during refactoring of the tested code). If you change the tested code in a manner you consider *valid*, you can approve any changes that result in the output files by running the provided approval script. + +*(I'm working on [simplifying this step](https://github.com/maxbechtold/golden-master/issues/2)) + + +## Requirements +Java 8 diff --git a/src/main/resources/docs/ide-support.PNG b/src/main/resources/docs/ide-support.PNG new file mode 100644 index 0000000..b226fd8 Binary files /dev/null and b/src/main/resources/docs/ide-support.PNG differ