Choose what to test
To test a change well, you need to know what it reaches. Niro lists what calls the changed code, through as many levels as you ask. It also lists the routes, tables and events on the way.
How
niro ask get_reverse_call_chain method_fqn=PriceCalculator.total depth=3
niro ask get_blast_radius method_fqn=PriceCalculator.total
get_reverse_call_chainlists callers up to the depth you ask (3 by default, 8 at most), 300 to a page.get_blast_radiusadds what the method calls, and the routes and events in between.
Things to know
- Test code is in the graph. Callers that are tests are marked
[test], so you can see which tests already reach the change. - The VERIFY purpose leaves the marks out. With
purpose=VERIFY, an answer gives names only, and drops the[test]and[possible]marks. Leavepurposeempty when you need them. - A
[possible]caller is one Niro could not tie down to one target. For example, the call is made on a value whose type the code does not state. Check those by reading them.
Playbook
Test a change finds, in one call with answer=locations, the six Keycloak tests the code makes possible three levels up through an interface, of which four really run JpaUserCredentialStore.createCredentialEntity. Two use a user stored outside Keycloak's database, so at run time they go to another store. It also checks the list against a grep.