DEV Community

kealanheena
kealanheena

Posted on • Edited on

Makers Week 10: Solo Challenges

Weekly Goal:

Can you solve a challenging technical problem by writing well-crafted code?

We started individual challenges this week, the main thing we focused on was the process so making sure we were doing our test first and following the single responsibility principle.

Day 1

I wasn't well at the start of the week but I knew we were doing tech tests so I look into some tech tests so I'd know what to expect.

Day 2

On day two I got started on the bank statement task which and to be able to make a deposit and withdrawal as well as view your bank statement. The way I decided to start this problem was to start by making everything in one class then breaking it up into smaller classes. After that, I moved on to writing my first test which was easy enough. I managed to get it working and passing the acceptance criteria. But I know I had to break it up into smaller classes because of the single responsibility principle.

Day 3

On this day I had to split my class up I decided to split it into two classed first and then break that up into smaller classes if I needed to. I found this to be quite tedious because after splitting them into I would then have to split the tests as well. I would also have to refactor some of the tests that used methods that were being moved to the new class.

Day 4

I had to still split my classes more because they were doing too much. I split each of the two classes I made into two smaller classes. This made my classes significantly easier to read. It also meant that I was following the sing;e responsibility principle which was in part the point of this week making our process better.

Day 5

At the end of the week, I noticed something weird, my tests were only passing if all the quotes were single quotes (') or they were double quotes ("). I found out that when the output was in single quotes the \n wasn't being processed into a line break. I also started adding mocks and doubles to my test but I didn’t get that done.

Summary

This week went well although if I were going to do it again I would split the classes up early on, but I know that is the better way to do it I just wanted to challenge myself a little. Next week we start our final projects so hopefully by next week I'll be halfway through creating a game.

Top comments (0)