简体   繁体   中英

Unit testing Jade

What techniques and design strategies have people used to aid in unit testing Jade applications? In particular, how do people typically go about testing Behaviours - which are tightly coupled to the Agent instance and the Jade environment? I'm aware of the JadeMX project, but this appears to be geared more towards system testing - in particular the message exchange between collaborating agents.

Thanks.

JADE has a tendency to overuse inheritance, which, as you rightly point out, results (among other things) in highly coupled, difficult-to-test Behaviours.

In work, we wrote an adaptive layer that sits between our Agents/Behaviours and the JADE ones, and allows us to test our behaviours in isolation. We plan to release this as OSS, but there are a few administerial hoops to jump through first.

At home, I've started work on jade-oo , a backwards-compatible refactoring of JADE that uses unit-testable POJOs for Behavioural logic. It's still pretty much in the alpha stage, but so far I've been able to produce Behaviours with much less boilerplate code, and much more testable logic.

Update: I've added examples and documentation to the jade-oo site. Please do take a look and let me know what you think.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM