Professional Documents
Culture Documents
Question 1:
A testing team has a software to send commands to the Telematic Control Unit (TCU) of a car.
Those commands are given manually by the engineers, which leads to several failures because the
commands are not aligned with the established pattern.
Implement a code to check if the introduced commands match the following rules:
1. A command must begin with [AT+], this is the protocol label
2. After the protocol label, it must appear a word, which could be [BREWAPP] or a word containing [A-Z]
3. If the command is [BREWAPP], it must be followed by [=$] and a word containing [A-Z]
4. If the command is not [BREWAPP], it could be followed by [?] or [=]
5. If the command is not [BREWAPP] and followed by [=], it must have additional words containing [0-
9] separated by [,]
A list of accepted commands are provided as an example:
AT+CREG?
AT+CSQ
AT+COPS=1,2,25077
AT+BREWAPP=$GETPLATFORM
The program must receive a list of commands and should print True or False for each command.
Example:
Given the following command list: ["AT+BREWAPP=$ECALLSIMMULTIPROFILE", "AT+WREGC=0",
"AT+BREWAPP=$ECALL_SETPARAMETERS,+79104397614", "ATM+DON", "AT+CREG", "VIN"]
The output must be: True, True, False, False, True, False
Solution Code:
def check(test_str):
import re
pattern= r"(AT\+)([A-Z]*|BREWAPP)(=\$[A-Z]*|\?|=|)([0-9\,]*)"
if re.search(pattern, test_str):
else:
check(test_str='AT+BREWAPP=$ECALLSIMMULTIPROFILE')
check(test_str='AT+WREGC=0')
check(test_str='ATM+DON')
check(test_str='AT+CREG')
check(test_str='VIN')
Question 2:
A testing team must implement a software to detect if the car is being pulled by the tow truck.
To do it, they have a list of accelerometer measure values given by the Telematic Control Unit over a
period of time.
The condition to ensure that the car is being pulled is to have 4 consecutive measures that exceed a
given threshold.
The threshold value is 40 degrees.
The list of values contains the Latitud, Longitud and the Height of the car. The height is the one to be
checked.
The program should raise an exception if the car is being pulled. Otherwise, it should return nothing.
Example:
Given [(40.446195, -79.948862, 25), (40.446195, -79.948862, 28), (40.446195, -79.948862, 30),
(40.446195, -79.948862, 22)] the program should return nothing
Given [(30.55443, 45.95542, 2), (30.55443, 45.95542, 1), (30.55443, 45.95542, 4), (30.55443, 45.95542,
30), (30.55443, 45.95542, 42), (30.55443, 45.95542, 45), (30.55443, 45.95542, 48), (30.55443,
45.95542, 50), (30.55443, 45.95542, 42)] the program should raise an exception
Solution Code:
def check(test_str):
if list[-1]>40:
cntr+=1
else:
cntr=0
if cntr==4:
return
Given a set of requirements describing how an emergency call (using SOS button) is
performed by TCU, propose at least one test (describing the test steps in natural language)
to validate all the requirements implemented in TCU SW. Indicate also if there is any conflict
or missing requirement.
Considerations:
You have only access to TCU interfaces (incoming and outgoing signals or
messages).
You have access to TSP server so you can check received data/messages and force
actions.
TCU connectivity:
Glossary:
REQ005 The eCall LED shall be STEADY ON when and only when eCall service is
operational and not busy.
REQ006 The eCall LED shall be BLINKING when and only when eCall service is operational.
REQ007 TCU shall inform to the IT Master about start timing for the voice conversation of
ECall to IT Master as soon as switch to voice conversation mode.
Additional information:
Q4- Below is a list of problems that can be observed during testing or in production.
Which one of these problems is a failure?
a) The product crashed when the user selected an option in a dialog box.
b) One source code file included in the build has the FALSE version.
c) The computation algorithm used FALSE input variables.
d) The developer misinterpreted the requirement for the algorithm.
Q12 - Which of the following describes structure-based (white-box) test case design
techniques?
a. Test cases are derived systematically from models of the system.
b. Test cases are derived systematically from the tester’s experience.
c. Test cases are derived systematically from the delivered code.
How many test cases would be needed for 100 per cent statement coverage?
a. 2
b. 4
c. 6
d. 7
Final answer: a
Q15 – Valid values for a CAN signal used by your program are [00-AA) & (AC-FE].
Which is the minimum set of values you shaall use for program testing:
I- 00,any value between 01 and A9,A9,AA, AB,AC,any value between AD and FD,FE, FF
II- 00,AA, FE, FF
III- 00, AB, FE
IV- 00,A9,AA,AC,AD,FE, FF
Q16 - Which of the following are valid justifications for developers testing their own
code during unit testing?
I- Their lack of independence is mitigated by independent testing during system and
acceptance testing.
II- A person with a good understanding of the code can find more defects more quickly using
white-box techniques.
III- Developers have a better understanding of the requirements than testers.
IV- Testers write unnecessary incident reports because they find minor differences between the
way in which the system behaves and the way in which it is specified to work.
Q17 - A new system is about to be developed. Which of the following functions has
the highest level of risk?
a. likelihood of failure = 20%; impact value = £100,000
b. likelihood of failure = 10%; impact value = £150,000
c. likelihood of failure = 1%; impact value = £500,000
d. likelihood of failure = 2%; impact value = £200,000