0

I have a class that does reboots a machine and then prompts it for readiness. The prompting is done via ssh and the standard output needs to be formatted to verify if the machine is in ready-state. So should I write tests for the method that does the parsing? There's no actual logic in there, just cutting and joining of a string. I have to run some integration tests anyway to verify it, so is there a point in writing a unit test for it?

asked Jun 21, 2017 at 15:46
1

1 Answer 1

3

I would think a unit test would verify that the parsing works correctly. Whether or not it's strictly required might be of some debate, but I'd say it wouldn't be a bad thing.

Unit tests are supposed to offer fast feedback on broken expectations. That's (one of) the considerable advantages over an integration test, which is not really expected to be fast or to run nearly as often as unit tests.

As such, it would probably be a decent argument to say that a unit test that verifies the string cut/paste operations would be better than just having it tested as integration.

answered Jun 21, 2017 at 15:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.