Summer CMSC 131 Exam 2 Study Guide (100% Correctly Answers)
What is the difference between formal verification and testing? correct answers - prove test is correct, bad: time consuming and hard - write test code to check production code, anyone can do it, bad: never quite sure its correct, cant test everything Unit Testing vs Integrated Testing correct answers - frontline, unit like a method, test each little unit - if units work together, possibly whole project JUnit correct answers - part of Java - framework that lets you write tests for code - can be written concurrently and is kept forever with project Assertions correct answers - assertTrue: if true passes, if not, fails - assertFalse (boolean expression) - assertEquals(x,y) JUnit Recommendations correct answers - lots of tests - keep test code simple - try to find "edge" and "corner" cases JUnit Observations correct answers - tests run in arbitrary order - two ways to fail: fail assertion, throws an exception - all tests will run even if some fail - if assertion fails, test is aborted Memory Diagram: Stack correct answers - is an abstract data type - when adding, does it to the top "push" - for removing, take the one off of the top "pop" Keyword "this" correct answers - sense in places where there is a current object (instance methods, constructors) NOT static method - is a reference to a current object Ways to Use "this" correct answers - inside constructor could do ( = name;) - inside instance method ((this)) - passes curr obj as variable - can call a constructor from another (must be first line) (this(nameIn)); What do we mean by user in terms of projects? correct answers - means another programmer making use of our code in their project - ex: we are users of Scanner, String class
Written for
- Institution
- CMSC 131
- Course
- CMSC 131
Document information
- Uploaded on
- September 21, 2023
- Number of pages
- 8
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
what is the difference between formal verification
Also available in package deal