Calculator, does passing all the tests matter?

I think my calculator works pretty well, it also seems to pass most of the tests in functionality ie ie you cannot enter a number like 5.5.5 or start a number with multiple 00s but it does not pass many of the tests. I had a similar problem with the drum machine, it works but did not pass the final test. https://codepen.io/Egglearn/pen/OJVEwEy?editors=1111

I am starting to wonder whether it is worth putting time in to get it to pass a test or should I be happy that it functions as intended as therefore passed the ‘test’ and move on? Let me know your thoughts

https://codepen.io/Egglearn/pen/WNvKgGj?editors=1111

If you are going to submit the project then it needs to pass all the tests.

1 Like

Yes.

I think my calculator works pretty well,

Right, but in the real world, the vast majority of the time you will be judged by how well you meet someone else’s standards. This can be very frustrating sometime.

I am starting to wonder whether it is worth putting time in to get it to pass a test …

I think it would be very useful. And it’s something you would have to do over and over and over in the real world. These skills are important.

2 Likes

You learn a lot covering the last 80% of finishing a project.

To imagine it another way, imagine if you were a tech lead and a junior developer came to you and said, “Yeah, I met most of the user stories … Is that good enough?”

1 Like

It’s probably worth checking why the tests don’t pass.
The calculator doesn’t work properly as far as I can tell.

Thanks for the responses, I will keep working on it and try and find out what is wrong with how I have written the code. I guess where it feels unproductive for me is when I can view that it does what the test asked for, eg in in the calculator above you can’t enter 5.5.5 but it still does not pass the test or you can’t start a number with 00 but it does not pass the test. Totally agree that “Yeah, I met most of the user stories … Is that good enough?” would not going down well at work!

1 Like

Thanks, I will repost with specific questions for the tests to try and find out why bits do not pass the tests

thanks Bob , I just read your previous post here

and noticed the connection with my post

1 Like

But again, most of the time irl you won’t get to decide what criteria you need to meet, but it will be decided by others. Sometimes they will be subtle things and difficult to track down. There are very specific instructions in the user stories. If a test is failing, then it means one of two things: 1) The test is incorrect. 2) Your code doesn’t meet the requirements.

These tests have been used of a while, so I’m inclined to assume that it’s the second one. Part of being a developer is learning to pay very close attention to very minute details. This is good training. Giving up because it is hard to find the problem is not.

Is there a specific test where you are having trouble?

1 Like

Hi Kevin, I agree it is number 2) so I am going to relook at the code, try and clean it up and see if I can find a way forward then I will repost with a specific problem if I still have trouble, I appreciate the feedback.

cheers

In all fairness, it is possible that the test doesn’t quite match up perfectly with what the requirements are saying. Let us know which tests you are stuck on and we can help figure out what the problem is.

@kevinSmith @JeremyLT @JanShah thanks for the advice last week, I have been working on it since then and it now passes all the tests. I learnt alot about regular expressions in particular and had to make some other small but important changes,

https://codepen.io/Egglearn/pen/poJBxgo

Cheers

2 Likes

Huzzah. That last 10% eats a lot of time but teaches so much!

1 Like