Automated Test Framework
You have likely heard of the Automated Test Framework (ATF) if you have been working with ServiceNow for more than a couple of months. Introduced in the Istanbul version, it has grown and been enhanced over time to allow for coverage of nearly all client interactions with the Now Platform. Even given that ATF has been present from Istanbul, there are still many existing projects that don’t utilize ATF due to not being available at the start of the project. Having run into this issue myself, I thought I would share my thoughts on how to get started with using ATF in existing projects. If you wish to learn a bit first, you can use the training here on the developer site or at Now Learning.
The very first step is on the surface straightforward. Start with a single test to validate the next story/feature/defect. “That’s it?” you might ask. I have found for existing projects and applications there is little need for a project plan and lots of overhead for how to get from 0% coverage to goal% coverage. Instead, the solution is, get started. Do one. Then have each developer on the project do one test per sprint. Include the tests along with the development work it was paired with between instances. Use your retrospectives to evaluate if things are going well. Start to add more goals, three tests created per sprint per developer. Soon you will need to switch your target to 50% of stories worked a sprint need to have coverage. Evaluate the effectiveness, adjust the process of the test creation, and running based on data.
Second stage of Maturity
Once you have several tests and even some test suites for your project or application, make sure to bake in the running of those tests early in the development cycle. Now that you have some familiarity with using ATF, you can start to look at how to approach testing in the platform more strategically. Beginning with the quick start tests ServiceNow provides for the software they provide is a great entry point. Utilizing the quick start test suites will allow for faster adoption and coverage.
Focus on the business-critical processes when determining which items to provide coverage against that are not part of on-going development test coverage creation. Inside of those critical processes also hones in on the parts of the process that might be more prone to errors and higher customization to get the most benefit out of the investment into ATF.
Utilize best practices when creating your tests to help keep long term maintenance lower. There are excellent practices baked into the training linked above so that I won’t go into them here. Keep test and test suites grouped and utilizing common naming schemes. Use parameterized testing to help reduce the number of tests while increasing coverage. Continue to bake in the care and feeding of the tests and suites into the regular build cycle.