Writing PSUnit tests

While we do not have the same level of convenience when it comes to unit testing in PeopleSoft, there is still a lot that we can accomplish with PSUnit. In a lot of use cases it offers great capabilities savings hours of manual testing. When I write my unit tests, I follow 3K rule: Keep It Simple, Keep Them Clean and Keep Them Working:

1. Keep It Simple - we are testing a single piece of functionality, and it makes a lot of sense to keep the test small with one logical assertion per test. We set up preconditions, run logic and verify post conditions. Nice, small and simple. Starter template can be viewed in this gist.

2. Keep Them Clean - Tests should not look like a quick and dirty scrap code. Make sure they are named well, and have an intuitive, understandable structure. They are an important tool that ensures system functionality and maintainability and save you a lot of time down the road. Remember what Uncle Bob said: "The only way to go fast, is to go well".

3. Keep Them Working - Tests should be executed often and should complete quickly. If a test fails, don't just fix the test - find the root cause and ensure it's resolved. While App Designer doesn't allow running tests out of the box, it's not too much trouble to execute them through PIA to ensure the system is working as it should.

Popular posts from this blog

Building an ML pipeline with ElasticSearch - Part 1

Stitching PeopleSoft and SharePoint

Kibana visualization cheat-sheet