This is a refactoring kata that focuses on working with data from different sources, including CSV files and network responses. You'll be improving an existing script by refactoring and extending its functionality.
A former colleague wrote a simple script to read user data from multiple providers. While the script works, it has become increasingly difficult to maintain and extend. Now that updates are needed, the code's tangled structure makes even small changes risky and prone to errors.
After discussing it with your manager, you've been given the green light to refactor the codebase and make it more maintainable. Your tasks are:
- Refactor the existing code while preserving its original behavior
- Break the logic into smaller, well-structured functions or classes as needed
- Consider both
black-box
andwhite-box
testing to verify correctness - Most importantly - have fun! 🎉
Modify the output logic to store user data in a different location, such as a text file or a SQLite database, instead of printing it to the terminal.
Instead of displaying the output through the terminal, store the information in a separate location, such as a text file or a SQLite database.
This kata is available in the following languages:
From php
folder, run:
php run.php
From javascript
folder, run:
npm install
node run.js
It is required at least
Node 18
to have access to thefetch()
library
From java
folder, run:
mvn compile exec:java -Dexec.mainClass="src.Main"
From kotlin
folder, run:
gradlew build
gradlew run
From python
folder, run:
python3 main.py