Summary

We've learned some principles on how to write rule unit tests, integration tests, and acceptance tests. Unit tests should test each rule in isolation while mocking all other components. Integration tests should test a knowledge base as a whole. The acceptance tests are geared toward more technically skilled business users. With a nice web interface provided by Guvnor, a user can test the rules by setting up input data with expectations. Guvnor then executes these tests and reports results back.

Static analysis of rules was shown as a very easy way of testing rules. Currently it provides only limited value, but as the drools-verifier module evolves, it may be a powerful tool in the future.

We've seen some techniques for rule troubleshooting. Starting with listeners that have lot of other uses, debugging in Eclipse, and to get a deeper understanding of the inner workings of a rule engine, and moreover, we've learned how to view the source of generated classes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.16.184