You are on page 1of 12

Advanced Automotive Antennas: Test and Validation exam

Programming exercise: Write a small program in a OO language such as Python,


Java or C# to solve at least one of the two questions.

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):

print ('true : %r' % (test_str,))

else:

print ('false : %r' % (test_str,))

check(test_str='AT+BREWAPP=$ECALLSIMMULTIPROFILE')

check(test_str='AT+WREGC=0')

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
check(test_str='AT+BREWAPP=$ECALL_SETPARAMETERS,+79104397614')

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):

for list in test_str:

if list[-1]>40:

cntr+=1

else:

cntr=0

if cntr==4:

raise Exception('Is suspended by a tow truck')

return

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
check(test_str=[(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)])

check(test_str=[(40.446195, -79.948862, 25), (40.446195, -79.948862, 28), (40.446195, -79.948862, 30),


(40.446195, -79.948862, 22)] )

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
Test design exercise:

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:

TCU: Telematic Control Unit.


MSD: Minimum Set of Data: Information sent by SMS from the vehicle to the server when an
eCall is launched. MSD contains VIN and GPS data.
VIN: Vehicle Identification Number (chassis number).
MPDT: TCU-ITM communication/signaling is done using MPDT messages through MPDT
channel.

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
TSP (or TSP server): Server to which TCU communicates during an eCall.
ITM ot IT Master: Vehicle head unit. ITM shall mute radio or multimedia when a voice call is
launched to allow user-server communication. ITM also display popups with information for
the user.
Prompt: Pre-recorded audio played by TCU or server during a voice call.

TCU EMERGENCY CALL (eCall) Nominal Scenario Requirements

REQ ID REQ description


REQ001 ECall service shall be activated by SOS button if and only if start conditions are met.
REQ002 TCU shall inform the IT Master with a call start notification when ECall starts.
REQ003 TCU shall send an MSD over SMS and then establish the voice call to call center.
REQ004 The MSD (Minimum Set of Data) is sent and processed as follows:
 Step1 - After the call is triggered, TCU will send out SMS with detailed data.
 Step 2 - After sending out SMS, TCU will initiate the voice call immediately
without waiting for SMS ACK from network.
 Step 3 - TCU must get SMS ACK from network within 70 seconds after SMS
is sent.
 Step4 - Call center must check vehicle identification and position on SMS
upon reception.

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.

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
REQ008 Sequence diagram for Nominal eCall Sequence establishment:

REQ009 Sequence diagram for Nominal eCall Sequence termination:

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
REQ010 When voice communication is established, TCU will start a watch timer (timeout = 20
seconds) to monitor Call process. During this period(20s), call must not be
aborted/ended.
REQ011 TCU shall play the prompt(C) to the driver when ECall service is ended.
REQ012 TCU shall inform ITM of call termination via voice call disconnected ECALL State
indication.
REQ013 TCU shall inform ITM of call service release via ECALL_end indication.

Additional information:

You can start with the following test sequence.

Check Ecall LED is ON


Push ECall Button
Check MPDT Message [ECall - Start]

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
Testing Fundamentals questions:
Q1 - Which of the following statements is the MOST valid goal for a test team?
a) To determine whether enough component tests were executed within system testing.
b) To detect as many failures as possible so that defects can be identified and corrected.
c) To prove that all possible defects are identified.
d) To prove that any remaining defects will not cause any failures.

Q2 - Which pair of definitions is correct?


a. Regression testing is checking that the reported defect has been fixed; retesting is testing
that there are no additional problems in previously tested software.
b. Regression testing is checking there are no additional problems in previously tested
software; retesting enables developers to isolate the problem.
c. Regression testing involves running all tests that have been run before; retesting runs
new tests.
d. Regression testing is checking that there are no additional problems in previously tested
software, retesting is demonstrating that the reported defect has been fixed.

Q3 - When is testing complete?


a. When time and budget are exhausted.
b. When there is enough information for sponsors to make an informed decision about
release.
c. When there are no remaining high priority defects outstanding.
d. When every data combination has been exercised successfully.

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.

Q5 - Which of the following is a non-functional requirement?


a. The system will enable users to buy books.
b. The system will allow users to return books.
c. The system will ensure security of the customer details.
d. The system will allow up to 100 users to log in at the same time.

Q6 - Which of the following are examples of iterative development models?


(i) V-model
(ii) Rapid Application Development model
(iii) Waterfall model
(iv) Agile development model

a. (i) and (ii)


b. (ii) and (iii)
c. (ii) and (iv)
d. (iii) and (iv)

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
Q7 - Which of the following is not true of regression testing?
a. It can be carried out at each stage of the life cycle.
b. It serves to demonstrate that the changed software works as intended.
c. It serves to demonstrate that software has not been unintentionally changed.
d. It is often automated.

Q8 - Which of the following statements are TRUE?


I. Regression testing and re-testing are the same.
II. Regression tests show that all failures have been resolved.
III. Regression tests are good candidates for test automation.
IV. Regression tests are performed to uncover defects as a result of changes in the
software.
V. Regression tests should not be performed during integration testing.

a) I and II are true


b) I, III and V are true
c) III and IV are true
d) II, IV and V are true

Q9 - Which of the following is most likely to be a benefit of using static techniques?


a. Fewer performance defects.
b. Productivity improvements in the development process.
c. More efficient regression testing.
d. Quick return on investment in static analysis tools.

Q10 - Which of the following statements are true?


(i) Defects are likely to be found earlier in the development process by using reviews
rather than static analysis.
(ii) Walkthroughs require code but static analysis does not require code.
(iii) Informal reviews can be performed on code and specifications.
(iv) Dynamic techniques are generally used before static techniques.
(v) Dynamic techniques can only be used after code is ready to be executed.

a. (i), (ii), (vi).


b. (ii), (iii), (v).
c. (i), (iv), (v).
d. (i), (iii), (v).

Q11 - Which of the following is most likely to be performed by developers?


a. Technical review of a functional specification.
b. Walkthrough of a requirements document.
c. Informal review of a program specification.
d. Static analysis of a software model.

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.

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
d. Test cases are derived from the developers’ experience.

Q13 - For the following program:


1 Program Grading
2
3 StudentScore: Integer
4 Result: String
5
6 Begin
7
8 Read StudentScore
9
10 If StudentScore > 79
11 Then Result = “Distinction”
12 Else
13 If StudentScore > 59
14 Then Result = “Merit”
15 Else
16 If StudentScore > 39
17 Then Result = “Pass”
18 Else Result = “Fail”
19 Endif
20 Endif
21 Endif
22 Print (“Your result is”, Result)
23 End

How many test cases would be needed for 100 per cent statement coverage?
a. 2
b. 4
c. 6
d. 7

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
Q14 -

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.

a. (i) and (ii)

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063
b. (i) and (iv)
c. (ii) and (iii)
d. (iii) and (iv)

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

Ficosa International, S.A.


Gran Vía Carlos III, 98 – 08028 Barcelona, Spain
www.ficosa.com – T. +34 932163400 – F. +34 934901063

You might also like