GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

CS 2110 Test 1

V L Englisch 51 Karten

Karten in diesem Stapel (51)

  1. 1objectan INSTANCE of a class with state/attribute and behavior
  2. 2classa TEMPLATE/BLUE PRINT that describes the behaviors/states that object of its type support
  3. 3methodbasically a behavior where logic and activities are carried out, data is manipulated, and all the actions are executed
    typically each method is associated with one distinct behavior
  4. 4instance variablesnon-static fields; unique values that describe an object's state
  5. 5variablea name associated with a reserved area allocated in memory
  6. 6local variablewhere a method stores its temporary state
    identified from its location (between { and } in a method
    only visible to the methods in which they are declared; not accessible from the rest of the class
  7. 7instance variables (non-static fields)values unique to each instance of the class
    declared inside the class but outside any other method
  8. 8class variables (static fields)any field declared with the static modifier; only one copy of this variable no matter how many times the class has been instantiated
  9. 9statically typedall variables must first be declared with type & name beore they can be used
  10. 10primitive type (8)int
    byte
    short
    long
    double
    float
    char
    boolean
  11. 11primitive typea data type predefined by the language and named by a reserved keyword
  12. 12byte8-bit signed two's complement integer
    min: -128
    max: 127
    default value: 0
    4 times smaller than an int
  13. 13short16-bit signed two's complement integer
    min: -32,768
    max: 32,767
    default value: 0
    2 times smaller than an int
  14. 14int32-bit signed two's complement integer
    min: -2,147,483,648
    max: 2,147,483,647
    default value: 0
    GENERALLY USED AS DEFAULT DATA TYPE unless there is a memory concern
  15. 15long64-bit signed two's complement integer
    min: -9,223,372,036,854,775,808
    max: 9,223,372,036,854,775,807
    default value: 0L
    used when a wider range than an int is needed
  16. 16floatmainly used to save memory in large arrays of floating point numbers
    never used for precise values such as currency
    default value: 0.0f
  17. 17doubleDEFAULT data type for decimal values
    should never be used for precise values
    default value: 0.0d
  18. 18booleanrepresents one bit of information
    true or false
    default value = false;
  19. 19charused to store any character
    must use single quotes
  20. 20immutableonce created, the value cannot be changed
  21. 21reference variablescreated using defined constructors of classes
    used to access objects
    default value: null
  22. 22literalsource code representation of a fixed value
    represented directly in the code without any computation
    e.g.
    char x = '\u0001';
    byte = 68;
  23. 23primitive data type ranking(highest)
    double
    float
    long
    int
    short
    byte
    (lowest)
    java will automatically convert lower ranked value to higher ranked values
  24. 24castinggoing from a higher ranked data type to lower ranked type
    double d1 = 123.7;
    int x;
    x = (int) d1;
  25. 25integer divisiondiscards the remainder
    occurs when both values are integers
    can be solved by casting
    int x = 10, y = 4;
    double d1;
    d1 = (double) x / y
  26. 26non-referenctae types (primitive typese)int x = 4;
    int y = x;
    two COPIES of the data are made
  27. 27What happens when a field is declared but not initialized?fields that are declared but not initialized will be set to the default value by the compiler
  28. 28verificationshowing that the code meets the requirement specification
  29. 29validationshowing that the code meets the real requirements
  30. 30qualitysuggests that validation falls on a scale
  31. 31specificationa precise and detailed statement about the properties something must have
    Design specification: exact instructions for how to build something
    Requirements specification: exact statements about what should be built
  32. 32unit testingwrite code that tests the smallest possible units of the spec
    must attempt to test every flow path
  33. 33integration testingtest that units work together
  34. 34acceptance testing (beta testing)give product to real users to try it out
  35. 35flow patha unique execution sequence through a program unit
  36. 36clear box testing glass-box / white-box testingexamine the code to decide what test cases are needed
    test based on the logic of the code
  37. 37black-box testingtest only based on inputs, outputs (i.e. the specification) w/o looking at the code
  38. 38Goals of unit testing- ensure quality
    - improve developers' lives (coping, confidence)
    - support design flexibility and change
    - allow iterative development with working with code early
  39. 39unit testing benefits- developers can work in a predictable way of developing code
    - programmers write their own unit tests
    - get rapid response for testing small changes
    - encourages programmers to build many HIGHLY-COHESIVE, LOOSELY-COUPLED modules to make unit testing easier
  40. 40Your jUnit test code must:- set up what's needed for testing
    - create objects, allocate resources, create relationships, etc.
    - call the method to be tested
    - verify that the method did what you expected
    - clean up
  41. 41coverage% of lines covered
    % of flow paths covered
    % of input sequences covered
  42. 42Steps in test-first, test-driven deign- Write a "stub" (just the signature & dummy return value).
    - Write many test cases.
    - Implement the method until the test cases pass.
  43. 43Benefits of TDD1. Less temptation to skip on testing, forces you to be meticulous
    2. More likely to think about every part of spec in coding
    3. Less likely to test only what works
  44. 44input domaininput space, output space, and internal space
  45. 45inputthe set of possible arguments, input streams, and events
  46. 46outputthe set of possible returns, output streams, and side effects
  47. 47internalthe input/output spaces of the operation used inside the method
  48. 48software engineeringthe technological and managerial discipline concerned with systematic production and maintenance of software products that are developed and modified on time and within cost estimates
  49. 49software lifecycle phases1. requirements ("specification")
    2. design
    3. implementation ("coding")
    4. integration phase
    5. release
    6. maintenance
  50. 50requirements- statements of what the system should do (or what qualities it should have)
    - from the customer or client point of view
    - not expressed in terms of a solution
    Should be:
    - clear, unambiguous
    - consistent, complete, feasible, testable
  51. 51designa description of how a solution will be implemented

Informationen

Beschreibung
Karteikarten am CS 2110 Test 1, erstellt von V L am 20/09/2016.
Erstellt von
V L
Aufrufe
1
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck