In this repo you will find all the materials you need for "Real world Evolutionary Design" hands-on.
The slides are available here.
Create a simple command line application that indexes all the text in pictures from a given directory.
Let's call it pictures-analyzer
.
By launching the following command, all pictures in images
folder are indexed:
pictures-analyzer index --directory images
pictures-analyzer
will interact with two external systems: the safe box and the search engine.
The safe box is a secure storage service used to upload pictures and make them available to allowed users.
Search engine is a REST api that indexes picture content. To be able, to find a picture by the text it contains, pictures-analyzer
will use the index
api to bind the picture in the safe box and its text.
- Time: 30 min
- Definition of done:
- Implement
Analyzer.index()
method and all its unit tests - If you have enough time, make the acceptance test pass
- Implement
- Rules:
- Write one first unit test at the top
- Whenever your test or implementation needs something, create a stub
- Write the next unit test until you reach the bottom layer
- Constraints:
- TDD:
- RED: Write only one failing unit test at time
- GREEN: Write only enough amount of code to make this failing test pass
- REFACTOR: Clean up the mess you just made (Think about naming, magic values, non accidental duplication...)
- You should never modify the given acceptance test. Therefore, you can modify the setup section of this test if needed
- In
Analyzer
class, you are not allowed to import any code (type, library, module, object, whatever...) outside its package library - You are not allowed to add any other public methods in this class
- TDD:
-
Get the code in your favorite programming language (python or java)
./start_workshop.sh
-
Run all the tests
-
You should have only one failing test. It is an acceptance test
-
Take a look at this test and understand what is missing
-
This test should guide your implementation
💡 Take a look at the step by step instructions for python and java.
-
Time: 20 min
-
Goal:
- Think about a better way to restructure files in packages.
- Take advantage of the test harness to refactor.
-
Hints:
- Get the code
./start_workshop.sh 2
- Now, the acceptance test is passing.
- Take a look at the implementation.
- What do you like about this implementation?
- What would you do better?
- What was hard to change?
- Identify where the external libraries are imported.