News
Another flaw in assignment "Metamorphic Testing"Written on 10.07.23 by Dominic Steinhöfel Dear seminar participants, Stanimir discovered another problem in the current assignment. In the function "test_tiny_c_interpreter_with_wrong_dict," the "wrong_dict" was initialized only once. However, every call to "interpret_tiny_c" changes the dictionary, resulting in the interpreter being… Read more Dear seminar participants, Stanimir discovered another problem in the current assignment. In the function "test_tiny_c_interpreter_with_wrong_dict," the "wrong_dict" was initialized only once. However, every call to "interpret_tiny_c" changes the dictionary, resulting in the interpreter being called with a potentially different dictionary every time. A correct implementation of the function looks like this: def test_tiny_c_interpreter_with_wrong_dict(): """ This function tests the Tiny-C interpreter with the metamorphic oracle provided by `get_transformation_pair`. It completes normally in the case of success and raises an `AssertionError` otherwise. This version of `test_tiny_c_interpreter_with_wrong_dict` passes a non-trivial initial dictionary to the interpreter to test the error-finding capabilities of the metamorphic tester. :return: Nothing. """ wrong_dict = tuple({var: 1 for var in string.ascii_lowercase}.items()) for _ in range(20): generator = generate_transformation_pair( DEAD_CODE_INSERTION_GRAMMAR_2, TINY_C_GRAMMAR, constraint ) for pair in itertools.islice(generator, 5): left = str(pair.filter(lambda node: node.value == "<left>")[0][1]) right = str(pair.filter(lambda node: node.value == "<right>")[0][1]) result_left = interpret_tiny_c(left, dict(wrong_dict), gas=20) result_right = interpret_tiny_c(right, dict(wrong_dict), gas=20) assert result_left == result_right Mutable data structures are a constant source of trouble in programming. For this reason, I mostly work with immutable types in my research prototypes. Unfortunately, I was not that disciplined when implementing the current assignment. This could be a nice lesson to be learned. However, you were affected by this problem and might have lost time when trying to work around it. For this, I am very sorry. We will consider this context when grading this part of the assignment. All the best, |
Wrong assertion in "Metamorphic Testing" lab that, however, reveals an actual bug in tested functionWritten on 05.07.23 (last change on 10.07.23) by Dominic Steinhöfel Dear seminar participants, Justin (thanks!) pointed out that the final assertion/check in the "Metamorphic Testing" lab is wrong; it does not call the function `test_tiny_c_interpreter_with_wrong_dict`, but the original `test_tiny_c_interpreter`. Please correct these yourselves. However, I found… Read more Dear seminar participants, Justin (thanks!) pointed out that the final assertion/check in the "Metamorphic Testing" lab is wrong; it does not call the function `test_tiny_c_interpreter_with_wrong_dict`, but the original `test_tiny_c_interpreter`. Please correct these yourselves. However, I found a bug at this second call to `test_tiny_c_interpreter`, which is why I missed that problem. The root cause of this bug is the ambiguity of the Tiny-C grammar. For example, the program {a = 17;if(0) if(1) ; else a = 42;} has two parses: One equivalent to {a = 17;if(0) {if(1) ; else a = 42;}} which is the intended one, and one equivalent to {a = 17;if(0) {if(1) ;} else a = 42;} which is the first result returned by the EarleyParser. This latter alternative is not "dead code" and can alter the semantics. This is an excellent lesson on language ambiguity and the problems one may face when dealing with "grammarware." To solve this, we could resolve the ambiguity in the grammar, replace the grammar-based parser altogether, or adapt the grammar to work with ISLa's "packrat parser." This parser is currently not used since, for the current grammar, packrat runs into an infinite recursion problem. Long story short:
Best, |
Solution for Lab "Oracles" Updated | Speakers for Upcoming SessionsWritten on 03.07.23 by Dominic Steinhöfel Dear seminar participants, I just updated the solution for the lab on "Oracles." The previous "solution" did not contain solutions; I apologize. The speakers for our upcoming Delta Debugging/Input Reduction session will be Justin, Moritz, and Sasha. This implicitly defines the three speakers for… Read more Dear seminar participants, I just updated the solution for the lab on "Oracles." The previous "solution" did not contain solutions; I apologize. The speakers for our upcoming Delta Debugging/Input Reduction session will be Justin, Moritz, and Sasha. This implicitly defines the three speakers for our final regular seminar session. Best, |
Lab 06 (Property-Based Testing): Alternative Solution Strategy for BExp ObjectsWritten on 03.07.23 by Dominic Steinhöfel Dear all, I wanted to share an alternative solution strategy proposed by Stanimir (thanks!) for the arithmetic expressions example in Lab 06. My proposed solution was bexps_strategy: st.SearchStrategy = st.recursive( # The non-recursive base cases. st.builds(BTrue) |… Read more Dear all, I wanted to share an alternative solution strategy proposed by Stanimir (thanks!) for the arithmetic expressions example in Lab 06. My proposed solution was bexps_strategy: st.SearchStrategy = st.recursive( # The non-recursive base cases. st.builds(BTrue) | st.builds(BFalse) | st.builds(BVar, st.text()), # The recursive cases. lambda children: ( st.builds(BNot, children) | st.builds(BAnd, children, children) | st.builds(BOr, children, children) ) ) This approach is inspired by a JSON example using standard Python datatypes such as dicts. In that case, the powerful "builds" strategy cannot work since obtaining information about the intended structure from the ADT definitions is impossible. I used "recursive" since "build" failed when applied to the abstract "BExp" dataclass. Yet, Stanimir found out that you can join the "builds" for all the cases: alternative_bexps_strategy: st.SearchStrategy = st.builds(BTrue) | st.builds(BFalse) | st.builds(BVar) | st.builds(BNot) | st.builds(BAnd) | st.builds(BOr) This more straightforward solution approach should be preferred in practice (for maintainability reasons etc.). You may also find this helpful. I recommend using Hypothesis where appropriate if you're developing in Python! Best, |
Next seminar meeting moved to Wednesday June 14 17:00Written on 05.06.23 by Andreas Zeller Dear all, Due to conflicting appointments, I have to move our next seminar meeting. We will not meet on Monday, but instead on Wednesday. June 14, 17:00 at the same Zoom link. If you cannot make it on this date, please drop me a note. Manuel and Mohamad are the designated presenters of the next… Read more Dear all, Due to conflicting appointments, I have to move our next seminar meeting. We will not meet on Monday, but instead on Wednesday. June 14, 17:00 at the same Zoom link. If you cannot make it on this date, please drop me a note. Manuel and Mohamad are the designated presenters of the next paper. Note that the assignment dates stay as they are, so your current assignment will be due on Monday, and the next assignment will also be published on Monday again. Looking forward to seeing you next Wednesday -- Andreas Zeller |
Assignments 05, Task 1: Solution leakedWritten on 05.06.23 by Andreas Zeller Dear all, This is to confirm that the assignment sheet for exercise 05 (Testing with Mutations) also contains a solution for Task 1 in the end. This leak was unintended, but cannot be fixed now; at least, it will allow you to compare your solution against the official solution :-) Tasks 2 and 3… Read more Dear all, This is to confirm that the assignment sheet for exercise 05 (Testing with Mutations) also contains a solution for Task 1 in the end. This leak was unintended, but cannot be fixed now; at least, it will allow you to compare your solution against the official solution :-) Tasks 2 and 3 still remain to be done, and we wish you lots of enjoyment. Note that this material will also be the base for the coding assignment in evolutionary fuzzing starting next week, so independent solving is very recommended. All the best -- Andreas Zeller |
Two bugs in Compiler testing exerciseWritten on 01.06.23 by Andreas Zeller Hi everyone, We found and fixed two bugs in the current compiler testing assignment. Thanks to Stanimir and Faiq for bringing this up! 1. In the AST_ASSIGNMENTS grammar, the definitions of <Assign> and <AugAssign> are wrong. They should read
Hi everyone, We found and fixed two bugs in the current compiler testing assignment. Thanks to Stanimir and Faiq for bringing this up! 1. In the AST_ASSIGNMENTS grammar, the definitions of <Assign> and <AugAssign> are wrong. They should read
and
respectively. 2. Also in AST_ASSIGNMENTS, the definition of <lhs_expr> is wrong. It should read
with <lhs_Name> being defined as
These two definitions will enable proper parsing of assignments such as x = 42, and subsequently also with clauses. We apologize for the confusion. The above changes will make it far easier for you to produce a solution. |
Be sure to register in LSF before May 15 - now openWritten on 25.04.23 (last change on 26.04.23) by Andreas Zeller Dear all, I have fixed the "official" start of the seminar to April 24. Note that students are only allowed to register (or withdraw) in HISPOS/LSF for the "exam" within three weeks after the topic assignment or the seminar briefing. Hence, you must register for the seminar in LSF/HISPOS before May… Read more Dear all, I have fixed the "official" start of the seminar to April 24. Note that students are only allowed to register (or withdraw) in HISPOS/LSF for the "exam" within three weeks after the topic assignment or the seminar briefing. Hence, you must register for the seminar in LSF/HISPOS before May 15. All the best, Andreas Zeller
Update 2023-04-26: Registration in LSF is now open. |
Slides "How to give a good research talk" now availableWritten on 24.04.23 by Andreas Zeller Dear all, The slides of today's introduction talk, "How to give a good research talk," are now available at https://cms.cispa.saarland/isla23/materials/ or through the "Information -> Materials" menu. Enjoy! Andreas Zeller |
Preliminary Schedule PublishedWritten on 20.04.23 by Dominic Steinhöfel Dear seminar participants, Dear seminar participants, |
Welcome to "Specification-Based Testing and Debugging"!Written on 18.04.23 by Andreas Zeller Welcome to the seminar! Our seminar kick-off meeting will take place on Wednesday, April 19 at 17:00 If you have been assigned to the seminar, you should have obtained a link to register, and a link to the Zoom meeting. Please check your mail. Looking forward to see you! -- Dominic + Andreas |
Specification-Based Testing and Debugging
Description: How can one specify inputs and outputs for a program and use these to test and debug it thoroughly? In this advanced seminar, we study several seminal approaches to automated testing and debugging and implement them all in a few lines using the all-new declarative ISLa test generator. Our set of techniques includes:
- Grammar-based Testing
- Testing with Constraints
- Evolutionary Testing
- Property Testing
- Metamorphic Testing
- Explaining Failures
- and more!
The general process will be as follows: Each week, you get 1-2 reading assignments and write an abstract about them. We may also ask you to give an (ungraded) five-minute short presentation to kick off the discussion and improve your presentation skills. Having discussed the approach, you have another week to finish a programming assignment (using Python and Jupyter Notebooks). in which you implement the respective technique using the expressive ISLa framework.
At the end of the seminar, you give a 15-20 minute presentation on one of the techniques, including experiments you designed and conducted. We will determine your final grade from your abstracts (10%), your programming assignments (30%), and the final presentation (60%).
Requirements: This seminar requires creativity and ambition. Experience with declarative languages and symbolic reasoning is a plus. Prior knowledge in automated testing, debugging, and software engineering (esp. from earlier courses) will be beneficial. In your motivation, please mention relevant projects and courses you have taken along with your grades.
Registration: To register for this seminar, use the SIC Seminar Registration Page.