7 Replies Latest reply on Aug 14, 2008 12:38 AM by (Alistair_McLeod)

    Unit Tests?

    Christophe Herreman Level 1
      Hi all,

      I was wondering if there were any unit tests available. There doesn't seem to be anything in the SVN repository.

      regards,
      Christophe
        • 1. Re: Unit Tests?
          Level 1
          Hi Christophe,

          Yes, its rather embarrassing, there is none, although its debatable how much is actually testable - and that from me who is always telling the team here to test everything that could possibly break!

          Perhaps I could highjack this thread and lets start a discussion on what parts of the framework we feel should be tested?

          Cheers,

          Ali
          • 2. Re: Unit Tests?
            Christophe Herreman Level 1
            Hi Ali,

            I was thinking that the FrontController could use some tests. Did the command register, does it throw an error when you register the same command, can you unregister a command, does it throw an error when you pass in a class that does not implement ICommand (no), ...

            There might be other classes as well, but in general I think there really needs to be a test suite in order to have a comfortable environment to work with and expand the codebase. Especially since you will now accept community patches, I think we need to build in this security.

            regards,
            Christophe
            • 3. Re: Unit Tests?
              Level 1
              Hi Christophe,

              Yes, those all seem like great areas to test.

              So, all we need is for someone to submit a patch. See what I'm doing here. Community involvement is great ;)

              The first decision needs to be the package structure. The existing structure has /com/.. under the root, which, with hindsight, isn't great. Perhaps have a /tests/com/... and the tests sit under there?

              Going forward, we're going to look to how we can better structure the downloads, but we wanted to do a simple move of 2.2.1 onto Open Source, and not change anything in the proces.

              Best,

              Ali
              • 4. Re: Unit Tests?
                Christophe Herreman Level 1
                Hi Ali,

                the "tests" folder would indeed be good. I was thinking there should also be a "main" folder that sits next to the "tests" folder and that contains most of what is now under the root. The same goes for cairngormenterprise.

                So by doing that, there well be 2 projects for each version of Cairngorm in Flexbuilder. One is a Flex Library project which is the framework and one is a Flex project which is the testrunner. Both projects can contain a build file and there could be a top level build file that uses both underlying build files to build the sources and the tests and perhaps deploy the new downloads.

                What do you think?

                regards,
                Christophe
                • 5. Re: Unit Tests?
                  Level 1
                  my 2cents. I usually set my test's up this way. 2 projects. I've even done it this way in the eclipse plugin. http://www.newviewnetworks.com/nvnhome/blog/client/uploads/red5plugin-flexunit.swf
                  • 6. Re: Unit Tests?
                    Level 1
                    Since this is all pretty new I am not sure how formal everything will or should be, but I would suggest someone put together a design doc describing the proposed project / package structure for the tests. Once this is completed we then have the document reviewed and when all is agreed upon make a decision as to who should do what and when. Possibly someone could set up the test project and test runner while a few others could split up the classes which are to be tested, and write the tests.

                    Off the subject, I myself would like at some point to submit some simple .cmd files for running the builds. This would be useful for writing to the event logs etc.

                    Best,
                    Eric
                    • 7. Re: Unit Tests?
                      Level 1
                      Hi Guys,

                      Christophe has opened an entry on the Cairngorm bugbase and has attached some initial unit tests. I've only given it a quick glance, but it looks like a great start. I hope to get to looking at it next week, but please feel free to add your own comments.

                      http://bugs.adobe.com/jira/browse/CGM-3

                      Over time, we'll be using the voting mechanism of JIRA (on which the bugbase is built) to determine community thought on many submissions.

                      Best,

                      Alistair