• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 22 pages
Exam (elaborations)

Cse 2221 Final Updated Actual Questions With Correct Answers

Document preview thumbnail
Preview 3 out of 22 pages

Cse 2221 Final Updated Actual Questions With Correct Answers

Content preview

CSE 2221 Final UPDATED ACTUAL QUESTIONS WITH
CORRECT ANSWERS

Question 1.
The Implements Relation

ANSWER
The implements relation may hold between a class and an interface. If C implements I then
class C contains code for the behavior specified in interface I. This means that C has method
bodies for instance methods whose contracts are specified in I.
The code of C looks like this:
class C implements I {
// bodies for methods specified in I
}
The implements relation allows you to separate contracts from their implementations- a best
practice for component design.



Question 2.
The Extends Relation

ANSWER
The extends relation may hold between: 2 interfaces or 2 classes.
If B extends A then B inherits all the methods of A. This means B implicitly starts out with all
the method contracts (for an interface) or all the method bodies (for a class) that A has. B can
then add more method contracts (for an interface) or method bodies (for a class).



Question 3.
Overloading

ANSWER
A method (name) is overloaded when 2 or more methods have the same name, in which case
methods must differ in the number and/or types of their formal parameters (which the
compiler uses to disambiguate them)






,Question 4.
Interface Extension

ANSWER
If I1 and I2 are interfaces and I2 extends I1, then the code of I2 looks like this: interface I2
extends I1{
//contracts for methods added in I2
}
For interfaces all such methods are instance.



Question 5.
Testing

ANSWER
Testing is a technique for trying to refute the claim that a method body is correct for the
method contract. In other words, the goal of testing is to show that the method body does not
correctly implement the contract i.e. that it is defective



Question 6.
Tree Representation of Expression

ANSWER
Each operand (1,2,3,4,5,..) of an operator (+ - * /) must be evaluated before that operator can
be evaluated



Question 7.
Unit Testing

ANSWER
Best practice to test individual units of components of software (one class, one method at a
time)



Question 8.
Integration Testing

ANSWER
Testing what happens when multiple components are put together into a larger system






, Question 9.
System testing

ANSWER
testing a whole end-user system



Question 10.
Method Correctness

ANSWER
Look at method's contract, which is a specification of its intended behaviors. The actual
behaviors of the method (see body) must be within the allowed behaviors of the method (see
contract).



Question 11.
Test Plan/Fixture

ANSWER
A set of test cases for a given unit is called a test plan or a test fixture for that unit



Question 12.
Designing a test plan

ANSWER
To make testing most likely to succeed in revealing defects, best practices include: (1) Test
boundary cases: smallest, largest, and special values in the contract (2) test routine cases (3)
test challenging cases, ie ones that if you were writing the code, you might find difficult or
error prone



Question 13.
Test cases

ANSWER
Each input value and corresponding allowed/expected result is a test case. Test cases that do
not reveal a defect in the code do not help us to refute a claim of correctness. Test cases
exercises a single unit of code, normally a method. Test cases should be small and
independent of each other.

Document information

Uploaded on
October 11, 2026
Number of pages
22
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$17.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TopGradeInsider
4.1
(14)
Sold
194
Followers
1
Items
62615
Last sold
3 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions