Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does one unit test sections of code that are procedural or event-based
    text
    copied!<p>I'm convinced from <a href="http://www.masukomi.org/talks/unit_testing_talk_2/index.xul?data=slide_data.txt#page2" rel="nofollow noreferrer">this presentation</a> and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in the application I am currently working on, I walk away confused. It is a xulrunner application application, and a lot of the logic is event-based - when a user clicks here, this action takes place.</p> <p>Often the examples I see for testing are testing classes - they instantiate an object, give it mock data, then check the properties of the object afterward. That makes sense to me - but what about the non-object-oriented pieces?</p> <p><a href="https://stackoverflow.com/questions/2364/what-is-your-experience-with-unit-testing-in-practice#2390">This guy mentioned</a> that GUI-based unit testing is difficult in most any testing framework, maybe that's the problem. The presentation linked above mentions that each test should only touch one class, one method at a time. That seems to rule out what I'm trying to do.</p> <p>So the question - how does one unit testing procedural or event-based code? Provide a link to good documentation, or explain it yourself.</p> <p>On a side note, I also have a challenge of not having found a testing framework that is set up to test xulrunner apps - it seems that the tools just aren't developed yet. I imagine this is more peripheral than my understanding the concepts, writing testable code, applying unit testing.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload