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
Escuela, estudio y materia
- Institución
- CMSC 131
- Grado
- CMSC 131
Información del documento
- Subido en
- 21 de septiembre de 2023
- Número de páginas
- 8
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
what is the difference between formal verification
Documento también disponible en un lote