Programming for test Flashcards

1
Q

Why would a developer who knows high and low-level programming choose to use high-level programming?

A
  • High-level languages have built-in functions and libraries
  • High-level languages have more support/help
  • High-level languages have structures (such as selection and iteration)
  • High-level languages can be less machine-dependent/more portable and they are more compatible
  • requires fewer lines of code to be written
  • It is (usually) quicker to develop code in high-level languages
  • It is easier to find mistakes in code
  • The code is easier to maintain//understand
  • It is easier to structure code in high-level languages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What tests can a developer use to improve testing of their code?

A
  • could be tested with only 1s
  • It could be tested with different lengths of input
  • It could be tested with an input where the 1s and 0s vary
  • It could be tested with an input where the last two numbers are different
  • It could be tested with the empty string
  • It could be tested with a string of length one
  • It could be tested with two runs of 0s separated by a run of 1s / two runs of 1s separated by a run of 0s
  • It could be tested with invalid data (such as 1010abc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What only applies to local variables?

A
  • is only accessible//declarable//within scope (in the subroutine)
  • only exists while the subroutine/program block is executing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do developers use structured programming?

A
  • subroutines with parameters = more readible
  • parameter within subroutines = reused
  • iteration = more efficient
  • indentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain how the developer could use a combination of an array and records to store information about music records:

A
  • put each song in a record with the song title + datatype of each field
  • assign it to a variable named song 1 song 2 etc.
  • as they have the same record structure = collect them in an array
  • array name should be something like song_progranm_array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly