Download Final_Report - Repository TU Delft

Transcript
and the user name contained in the log line. Next a listener is needed to specify the logic of
when a single event or a set of events will result in a data point. This data point should then
be created containing the relevant details needed to answer the research question.
An implementation of the previous steps to, for instance research which search queries are
executed, could be:
• An event of containing the timestamp, user name and search query, called
SearchQueryEvent.
• An event factory containing a regular expression used to identify if a log line represents a
SearchQueryEvent.
• A data point containing the search query and the user that executed it.
• A listener that creates the data point from a SearchQueryEvent only if the search query
is not empty.
5.4
5.4.1
Testing
Unit tests
As testing framework we made use of JUnit[8]. For each class we defined unit tests to make sure
the individual functions work correctly, except for some classes that were generated with use of
the Lombok library. Lombok is a library that makes it easy to implement standard code blocks
using simple annotations[15]. The use of Lombok resulted in that some functions were added
that we not covered in our test classes, as these functions are already tested by the Lombok
developers.
We had trouble testing the classes that used the messaging system to receive input and
transmit output. This is because we could not properly mock or stub the inner workings of the
connection to the messaging system. This is partly of how we implemented these classes and in
this could definitely be improved upon. However we split up the responsibilities in those classes
and extracted their internal methods into other classes in order to test those methods using unit
test. In other classes we used stubbing to stand in for some other programming functionality
that were necessary for the execution of methods.
5.4.2
Field tests
A large part of testing our application comes from using field tests. As a source for testing the
validity of the produced results we used a log file we generated from using our test TOPdesk
application. Because we generated this log file by triggering specific events we could easily
compare the results of our application to what we know really occurred and thus ensuring the
validity of the results.
To test how our program works when handling large sets of data, we used the log files that
were generated over one week by the TOPdesk application used by the support department
of TOPdesk itself. This gave us a testing set of logs comparable to the actual data that our
program should process. These log files were used throughout the development process to test
the overall performance and scalability of our application.
17