3 ms·
I would be very surprised if an automated test literally took days to write when a manual test is just minutes. Also the time savings still pay off later, as a
by simonhamp 9y ago
I would be very surprised if an automated test literally took days to write when a manual test is just minutes.
Also the time savings still pay off later, as automated tests usually take seconds to run and there’s no training required - once it’s in the test suite and the test suite runs are automated, it will always run and quickly identify a failure - no “oops, we forgot to show Jim the Intern that he had to test that part manually...”
Setting up your test suite and automation is longer for sure, but not days. Even a complex manual process can be automated relatively quickly... the manual process should be fairly scriptable in any OS nowadays, and most platforms have great test frameworks.
- andrewflnr 9y agoThink about something that necessarily involves hardware interaction, or a GUI, or where all the interesting error cases are non-deterministic (concurrency, network error handling). Ok, on the last one you're pretty much hosed anyway. But we're not all writing nice data-in/data-out apps.
- crdoconnor 9y agoActually, I probably wouldn't count network error handling, because you can probably use something like vaurien - https://github.com/community-libs/vaurien https://github.com/community-libs/vaurien - to deterministically mimic bad network conditions in an integration test in a fairly reasonable amount of time. Also, integrating that tool would probably have applications beyond a single story so even if the change takes 5 minutes and making the test work with vaurien takes half a day, it's probably still worthwhile. Assuming that no tool like vaurien exists, though (and there are plenty of scenarios out there where you'd have to build it from scratch), building the test scenario could become prohibitively expensive.
- crdoconnor 9y agoTrust me you'll come across examples like this one day if you make a concerted effort to automate a test for every story. It's a rough guess but I'd say I don't automate 1 out of 20 stories - I'm not exactly blithely unaware of the benefits an automated test suite brings. Most of the examples that require "days" (or weeks) for the test and 5 minutes for the test would involve the building or amending an elaborate mock/stub. Some examples where this happens include rare interactions with weird hardware, odd legacy APIs that are scheduled to be replaced, race conditions and obscure edge cases with mocked services. I document all of these special cases and they should clearly remain special but I'm not going to blindly assume that automating the story will have a positive ROI.
- falsedan 9y agoLet me help expand your imagination: what if the code is for sshing to prod and needs a ssh-agent or a password typed in? Would you leave those cress on your CI system? Would Security be happy with that?
- albertgoeswoof 9y agoWhy would a test build ever ssh to production? If you absolutely need to test connecting to an external system you should mock it or create an environment for testing against. Your credentials should also be stored as env variables so the test ones are used only for the test environment.
- falsedan 9y agoBecause you're developing automated tools to deploy to prod & you're verifying the correctness of the system end-to-end with a no-op command. The connecting to an external system is not what's under test, and assume I've written unit tests that mock out the sshing, and that even with a staging environment I have to smoke test the new code before switching everyone over to the new version. Where are those env variables stored on the CI system? In the job config? I would use Vault for this.