100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSE 2221 Quiz 4 $12.49   Add to cart

Exam (elaborations)

CSE 2221 Quiz 4

 10 views  0 purchase
  • Course
  • CSE 2221
  • Institution
  • CSE 2221

Exam of 12 pages for the course CSE 2221 at CSE 2221 (CSE 2221 Quiz 4)

Preview 2 out of 12  pages

  • September 26, 2024
  • 12
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSE 2221
  • CSE 2221
avatar-seller
Nursephil2023
CSE 2221 Quiz 4
How important is testing in programming? - - very important it is expensive
and often takes 30-40% of the total project effort, for life-critical systems it
often is much higher percentage, software can have millions of lines of code,
so testing is important to prevent bugs from being released in the end-
product

- Best practice for testing? - - test individual units or components of
software at a time (such as one class, or one method at a time)

- unit testing - - test individual units or pieces of code for a system (such as
a method or class)

- Integration testing - - Testing what happens when multiple components
are put together into a larger system

- UUT - - unit under test

- system testing - - Testing a whole end-user system

- What does it mean for a program unit (such as a method) to be correct? - -
It means it does what its supposted to do
It doesn't do what it is not supposed to do

- Legal input is also known as? - - requires clause

- allowable result is? - - the same as ensures clause

- The method body is considered correct if? - - if the actual behaviors of the
method is a subset of the allowed behaviors of the method body.
For example refer back to aFactor(int n) method, it will return an int that is a
factor of n, if n = 12 it could be 1, 3, 4 but not 5, so if the method is
programmed to always return 1 no matter the value of n it would always be
correct as everything is a factor of 1

- When we write class C implements I what do we care about? - - ensuring
the the method body created in C follows the contract written in I, remember
that the java compiler doesn't do this, we must ensure that C follow the
contract for each method body

- What is testing? - - a technique for trying to refute the claim that a
method body is correct for the method contract

, NOTE: the goal of testing is to show that the method does not correctly
implement the contract, you are NOT trying to prove or show that the
method is correctly implemented

- Design and coding are thought of as ___________ activities
Testing is a _____________ activity - - creating; destructive

- Should the same person both do testing and coding? - - no, people don't
like finding out they made mistakes

- Goal of debugging - - given some source code that has a defect, find the
defect and repair it

- testing vs debugging - - testing- you try to "break" the code, find defects
debugging, you have a defect and you try and repair it

- Test plan / test fixture? - - set of test cases for a give unit (like a method
or class)
In JUnit testing this is a public class which one method per test case

- Test case - - each input value and corresponding allowed/expected result
for example if you have a method that add 2 to a number passed in as an
argument, the input of 2 should have an output of 4
In JUnit testing one method is a test case

- Program testing can be used to show the __________________ of bugs, but
never to show their ________________ - - presence; absence

- What type of cases should you test your code against? - - boundary cases
routine cases
challenging cases

- boundary cases - - "smallest", "largest" values and special values based
on the contract

- routine cases - - normal cases your program/ method would be used on

- challenging cases - - ones that if you were writing the code might be
difficult or error-prone

- Why are test cases that don't meet the requires clause useless? - - you
don't know what the output could be since it doesn't have to follow the
ensures clause

- What is the primitive type of testing? - - using main as a command
interpreter, where the user (tester) provides input and observes the actual

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Nursephil2023. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $12.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76945 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$12.49
  • (0)
  Add to cart