Professional Documents
Culture Documents
GRILE 2021 Bune
GRILE 2021 Bune
GRILE 2021 Bune
GRILE CTS
1. The term "zombie code" refers to:
a. Source code that contains many TODO comments
b) Legacy code
c. Source code containing commented pieces of code
d. The source code used
2. One way to avoid frequent updates (new versions) for the developed application is:
a. Moving code constants to the database
b. Writing short methods
c. Using enumerations to the detriment of strings
d. Establishing fixed data to which updates are launched
3. Design by contract is mentioned by the following principle:
a Liskov Substitution
b) Interface segregation
c) Single responsibility
d) Open closed
4. The letter “I” in the SOLID principle comes from:
a) Iskov Substitution
b) Investment Dependency
c Interface Dependency
d Interface Segregation
5. The Hungarion Notation system refers to:
a. Writing class names with capital letters
b. Using the date type in the variable name
c. Using underscore in variable names
d. Using visibility in naming attributes
6. Copying and pasting a piece of code (Copy / Paste) leads to the violation of the following principle:
a YAGNI
b) SOLID
c) KISS
d. DRY
7. The following code sequence violates the principle:
Class Processing {
Public void showUsers () {
//}.}
Public void processingDate () {
//…}
Pulib void savesInDb Constants () {
// ..}
};
Interface segregation
b) Liskov substitution
c) Open-closed
d) Single responsibility
8. The following code sequence refers to:
Class View extends… {
Public View (DataService _dataService, LoginService _loginService) {
_dataService = super.dataService;
_loginService = super.loginService;
}
};
Liskov substitution
b) Interface segregation
c) KISS
d) Dependency inversion
9. The following hierarchy of classes applies the principle:
Resizable Interface {
// ..}
Class Large screen implements Resizable {
// ..}
Class ScreenMic implements Scalable {
// ..}
a. KISS
b) Interface segregation
c) Single responsibility
d) Design by contract
10. The following code sequence violates the principle:
a. KISS
b) YAGNI
c. DRY
d) SOLID
11. Which of the following Git commands is used to copy changes to the Repository on the server on the
work machine
a. $ git commit
b. $ git pull
c. $ git push
d. $ git add
12. Which of the following Git commands is used to create a local copy of the project on the Main Repo
a. $ gitinit
b. $ git clone
c. $ git pull
d. $ git add
e. $ git push
13. Which of the following Git commands is used to save changes in a work session
a. $ git branch
b. $ git commit
c. $ git init
d. $ git status
e. $ git pull
14. Which of the following Git commands is used to pass to the branch named Project_CTS
a. $ git branch
b. $ git goes project_CTS
c. $ git checkout –b project_CTS
d. $ git checkout project_CTS
15. Which of the following Git commands determines the current status of the project
a. $ git init
b. $ git log
c. $ git add
d. $ git status
16. The following scenario is considered:
“ACME Inc. develop a software solution for a restaurant, you have the waiter to be able to take orders
directly from the mobile phone. The orders are taken from the customer and they are created on the
spot, being automatically assigned the specialized kitchen on that dish, the ingredients used and other
special requirements of the customer. These details are provided by the application, without the need
for the intervention of the waiter who only selects the required dish. The orders are sent to the chefs at
the end of the order for the respective table, and will be executed according to the degree of load of
each chef. "
What pattern offers a solution to this problem?
Command
b) Chain of Responsibility
c) Memento
d) State
17. Which of the following concepts is not a mandatory component used in defining a design pattern:
a. The advantages and disadvantages offered by the pattern
b. The problem for which the pattern offers a solution
c. The name of the pattern
d. Implementing the pattern in java
e. The solution offered by the pattern described by diagrams or pseudo-code
18. A design pattern represents:
a. A solution to a common problem in poo
b. An algorithm used in poo
c. A data structure used in poo
d. A scheme for a particular type of class
19. Which of the following GoG design patterns is of the Behavioral type:
a. Decorator
b) Strategy
c. Builder
d. Singleton
20. What GoF pattern must be implemented if you want to implement a solution that allows the choice
at run-time of the agglomeration / function necessary to process a data set. The solution must allow the
modification of the function library but not of the class that manages the data.
a.Wrapper
b) Facade
c. Decorator
d) Strategy
21. Which combination represents the correct types of design patterns?
Creational, Behavioral, Structural
b. Creations, Mediators, Adapters
c. Creations, Consumers, Composites
d. Mediators, Structural, Creative
22. What pattern allows to extend the functionality of an object, dynamically, to run-time?
a. Facade
b) Adapter
c Composite
d. Decorator
23. Memento is a design pattern of type:
a. Mediator
b) Behavioral
c. It is not a design pattern
d. Creational
e. Adapter
f. Structural
24. You are trying to add to your Solution a class written in another project to serve different clients. All
other classes have the same interface, but the added class has a completely different interface from
what customers expect . However, it contains all the necessary functionalities. What kind of refactoring
is needed to make this class right in your system, with minimal effort?
a. The proxy pattern applies
b. The builder pattern is applied
c. Apply the adapter patter
d. A new class is defined that implements the expected interface and is copied by copy & paste from
those class in this
e. The façade pattern is applied
25. If you want to implement a solution in which all customers using class A have access to the same
type A instance, which GoF pattern will be used:
a. No pattern is needed because the solution is implemented by marking class A as final
b. Singleton is implemented for class A.
c. There is NO need for a pattern because the Solution implements by defining class A as abstract
d. A reminder for class A is implemented
26. Choose the incorrect statement about TDD:
a. The steps in TDD are: Write and run tests, Correct method, Refactor
b. If the test generates fails, the test is corrected
c. It is based on the repetition of a simple development cycle
d. TDD describes the concept of Test Driven Development
27. There is no principle of Correct boundary conditions specific to the analysis of the data used in Unit
Testing:
a. Value has the type required by the variable type
b. The code refers to external components that are not directly controlled
c. The value has the correct format
d. The value is between the accepted limits (maximum and minimum)
e. The set of values must be ordered or not
f. The value exists
28. Consider the following UniTest. What is displayed after its execution ?
a.Before Test1 Test2 After
b Before Test1 After Test2 After
c Before Test1 After Before Test2 After
d Before Test1 Before Test2 After
29. Choose the correct statement regarding Unit Testing
a. A test unit is a sequence of code written by a programmer to evaluate a class or method
b. It takes place in the development phase and is a tool for programmers
c. All listed signatures are correct
d. A test unit evaluates how a method works in a well-defined context
e. Simple and fast method of testing the source code by programmers
30. Consider the following UnitTest. What is displayed after its execution ?
Who are the participants in the Prototype design pattern? Choose an option:
a Prototype, Abstract Prototype, Concrete Prototype
b Prototype Factory, Prototype
c Prototype, Virtual Prototype, Concrete Prototype
d Prototype, Concrete Prototype The correct answer is: Prototype, Concrete Prototype
Which of the following is a Singleton type? Choose an option:
a List of Singleton
b Thread Safe Singletoy
c) Singular Initialization
d Unic Initialization
The correct answer is: Thread Safe Singleton
Which of the following design patterns can be used when creating new objects by copying an
existing object? Choose an option:
a.Factory Method
b) Abstract Factory
c. Builder
d Prototype
The correct answer is: Prototype
An insurance application offers, in addition to taking out compulsory insurance, the possibility of
taking out health insurance, travel insurance and private pension insurance if the user so
wishes. What design pattern is found in this situation? Choose an option:
a Prototype
b) Factor
c. Singleton
d. Builder
The correct answer is: Builder
Which of the following is a usage example for Singleton? Choose an option:
a. Accessing mobile device resources
b Single database connection
c. DocumentBuilderFactory from Android
d All variants of suy
The correct answer is: All of the above
Which design pattern ensures the creation of a single object of a certain class?
Choose an option:
a Proxy
b. Singleton
c) Prototype
d Builder
The correct answer is. Singleton
Which of the following is considered the most correct type of Singleton? Choose an option:
a Lazy initialization
b Eager initialization
c) Inner static helper class
Thread Safe Singleto
The correct answer is: Thread Safe Singleton
Factory is used: Choose an option:
a to help create complex objects with many attributes
b to create objects from a class family ^
c. to create a single instance for a class and has the private constructor
d when creating an object consumes a lot of resources A prototype is created and used for
donation
The correct answer is: to create objects from a class family
Which of the following statements is true about Abstract Factory? Choose an option
a. Each factory will create a single object type
b. Simplifies the interface of a class family
c. It has as participant the concrete factory and the concrete classes
d. Introduces a new level of abstraction from the Factory Method
The correct answer is: Introduce a new level of abstraction from the Factory Method
What is the Singleton-Thread safe Singleton type? Choose an option
a. initialization of the court even if it is not used
b. assumes that the method will not be called by another thread until the method already called
on an executive thread is completed
c contains a class nested in the Singleton class
d. the most implemented Singleton variant
The correct answer is: assumes that the method will not be called by another thread until the
method already called on a thread is completed
What is the similarity between Prototype and Composite? Choose an option:
a Items on the same level cannot be donated
b Items on the same level can be donated
c. There is no donation
d No items can be donated
The correct answer is: Items on the same level can be donated
Who are the participants in the design of the Singleton scheme? Choose an option:
at Concrete Singleton
b Abstract Singleton
c. Singleton
d Singleton Factory
The correct answer is: Singleton
Which of the following statements about Eager Initialization is correct? Choose an option:
a. The court is never initialized
b. None of the above
c. It involves the initialing of the court even if it is not used
d. The initialization of the court is performed only if it is used
The correct answer is: It involves the initialization of the court even if it is not used
What is the difference between Factory Method and Simple Factory? Choose an option:
a. There are no differences between the two
b. None of the above
c. in Factory Method enum is no longer used, but abstracts the level of creation
d. in the Factory Method enum is used, no new level of abstraction is introduced
The correct answer is: in Factory Method enum is no longer used, but abstracts the level of
creation
Which of the following statements is true about Factory? Choose an option:
a. It is a creative design pattern
b. The client has the possibility to create concrete objects from a family of objects, without
knowing exactly the concrete type of the object
c. All the above variants
d. Objects are created using a common interface
The correct answer is: All of the above
What is the correlation between Factory and Singleton? Choose an option:
a. The items are donated
b. The factory can be unique
c. There is no correlation
d. The connections between classes
The correct answer is: The factory can be unique
Which of the following creative design patterns help create complex objects with many
attributes? Choose an option:
a. Singleton
b) Prototype
c. Factory
d Builder
The correct answer is: Builder
Which of the following statements is true about Singleton? Choose an option:
Singleton adheres to the principles of object-oriented programming
b. A Singleton object cannot be sent as a parameter to a function
c. Singleton is used to implement an abstract class
d. It does not involve the extension of a classic
The correct answer is: Singleton adheres to the principles of object-oriented programming
Who are the participants in the design of the Prototype pattern? Choose an option
a. Interface and method of copying and donating
b. Concrete class and interface
c. Donation interface and classes
d. Concrete classes
The cored answer is: Interface and method of copying and cloning
Factory is recognized by the phrase: Choose an option:
a. Creating concrete objects
b. Creating clones for objects
c. A single court
d. Objects from the same family
The correct answer is: Objects from the same family
What does Thread safe Singleton entail? Choose an option:
a Ensures that the method will not be called by another thread until the method already called on
one thread is completed /
b. The method can be called from another thread even if the method already called on one thread
is not completed
c. None of the above
d All of the above
The correct answer is: Ensures that the method will not be called by another thread until the
method already called on a thread is completed
Represents the use of the Singleton pattem design: Choose an option:
a. When created objects resemble each other and creating an object takes a long time or
consumes a lot of resources
b. Opening a single instance of an application /
c. Creating GUI views
d Existence of a family of objects in an application
The correct answer is: Open a single instance of an application
It's Singleton type: Choose an option:
Template Method ®
b. Thread Safe Singletoi /
c Virtual Builder
d) Chain of Responsibility
The correct answer is: Thread Safe Singleton
How many participants are in the Prototype design pattern? Choose an option:
a.4
b.8
c.3
d.5
What is the relationship between Prototype and Decorator Choose an option:
a Items on the same level can be donated
b A number of objects can be stored
c. The construction of an object is centralized
d Clone objects and then modify
The correct answer is: Clone the objects and then modify them
Which of the following statements is true about the Factory Method design pattern? Choose an
option:
a Has the same participant as Simple Factory
b. Switch or if-else structures are used to choose which objects will be created
c. It does not use enum, but abstracts the level of creation
d Concrete objects are used for the call
The correct answer is: Do not use enum, but abstract the level of creation
GRILLE BOJA 2021
What naming convention does the Arithmetic mean name? Choose an option:
Apps Hungarian Notation
lowerCamelCasy
Hungarian Notation System
UpperCamelCase
What naming convention is used to name classes and interfaces: Choose an option:
Hungarian Notation System
none of the options
lowerCamelCase
UpperCamelCase
When is the DRY principle applicable? Choose an option:
None of the options is correct;
Whenever we give Copy / Paste a piece of code /
Whenever we write methods that are not necessary yet;
Whenever we want a method to do everything;
What does the DRY principle entail? Choose an option:
Applicable whenever we want a method to do everything
Applicable whenever we give Copy / Paste to a piece of code or when two methods do the
same lucryr
Applicable whenever we write methods that are not needed yet (may never be needed )
None of the above
Which of the following are clean code rules in methods? Choose an option:
will always try to get out of service as soon as possible
Any method is recommended to have at most three levels of nested structures ;
All variants are correct;
The variables will be declared as close as possible to their use ;
Which of the following is a Clean Code rule in the comments? Choose an option:
Avoiding introductory comment blocks /
It is not recommended to use comments for TODO comments;
Comments are not indicated for libraries that will be reused by other programmers ;
Commenting unused code ;
What does Bad Code mean? Choose an option:
Don't be misled
Independent of other code sequences
It breaks when we change it
Easy to read and understand
Which of the following are the principles of CleanCode? Choose an option:
DRY;
SOLID;
YAGNI;
All options are correct ^ /
Which of the statements is true? Choose an option:
Objects should not be forced to implement unnecessary methods
A class must have only one responsibility
All variants
Classes must be open for extensions, but closed for changes
Which of the following principles is derived from KISS ? Choose an option:
SOLID
DRfc
None of the options is correct
YAGNI
The Open-Close principle presupposes . Choose an option:
Classes must be open for extensions and closed for modification /
Failure to repeat pieces of code
Classes must be closed for extensions and open for changes
A class must be responsible for one aspect
Which of the following are the rules for writing source code? Choose an option:
The closing bracket of an instruction body is the only one on the line;
All options are correct /
Instruction blocks are also marked by identification ;
Code blocks start with {and end with};
What does the principle of Single Responsibility entail? Choose an option:
Multiple customizable interfaces are always preferable to a single general interface ;
Classes must be open for extensions, but still closed for changes;
A class must always have only one responsibility and only one /
Objects can be replaced at any time by instances of derived classes without this
affecting functionality;
Among the benefits of complying with the KISS principle are: Choose an option:
easy solving of complex problems
all variants are corrective
the written code is more flexible
making products easy to maintain
Which of the following statements about YAGNI is true? Choose an option:
It is derived from KISS
It involves writing methods that are not necessary
Use interfaces
It is known as "Design by Contract"
What is the principle by which it is not recommended to write 2 methods that do the same
thing? Choose an option:
DR Y
YAGNI
KISS
None of the above
What does Clean Code entail? Choose an option:
The code should be easy to change
All variants
The code should be easy to read
The code must be easy to understand
Objects can be replaced at any time by instances of derived classes without affecting
functionality. What is the principle? Choose an option:
Liskov substitution (LSP)
Investment dependency
Single Responsibility (SRP)
Open-Closed (OCP)
Which of the following is not a good practice in writing source code? Choose an option:
Instruction blocks are marked and the indentation
The parameters are separated by commas and spaces
Lines are separated by any number of methods goal ^
The closing brace of an instruction body is the only one on the line, except when we have if-else
or try-catch
What does Clean Code mean? Choose an option:
All variant ^
The code must be easy to understand
The code should be easy to change
The code should be easy to read
What does Code Review mean? Choose an option:
Working in pairs of programmers for tasks complex
Testing Automatic to Code on the basis of cases of use
Review any piece of code written by another programmer
Rewrite the code in a way that better adapts to the new specifications
What is the principle of OCP (Open-Closed) based on? Choose an option:
All the above options
A class must always have only one responsibility and only one
None of the above
A class must be open for extensions and closed for modification
What is the Interface Segregation principle ?
Choose an option:
Class 0 must be open for extensions and closed for changes
The class must always have only one responsibility and only one
Objects can be replaced at any time by instances of derived classes without affecting
the functionality
Multiple customizable interfaces are always preferable to a single general interface '
When the same piece of code is found in two methods, the principle was violated: Choose an
option:
YAGNI
DR Y
CMO
KISS
The principle also known as Design by Contract is: Choose an option:
Interface segregation
Investment dependency
Single responsibility
Liskov substitution
What is the violation of the YAGNI principle? Choose an option:
In copying pieces of code and integrating them into multiple areas of an application
In writing multi -purpose methods
None of the above
In writing methods that are not necessary ^
The SOLID-specific Open-Closed principle assumes Choose an option:
several specialized interfaces are preferable at the expense of a single general interface
classes can be easily extended ^
classes can be changed easily
Which of the following is not a feature of CleanCode? Choose an option:
The code must be easy to read;
The code must be easy to change;
The code must be easy to understand;
The code must be closely related to other codz sequences
Which of the following principles is derived from the KISS principle? Choose an option:
DRY
SOLID
YAG NI
None of the above
What is the One screen rule? Choose an option:
The variables will be declared as close as possible to their use
Avoiding very long methods (over 20 lines of codX
will always try to get out of service as soon as possible (by return or exception)
Avoiding methods with more than 2 parameters
Which of the following is not a simple Clean Code rule for methods?
Choose an option:
Delegation through pointers / interfetex
Single responsibility
Avoiding interfaces;
Keep It Simple and Stupid;
Interface Segregation Principle refers to:
Choose an option:
Classes must be open for extensions
Multiple customizable interfaces are always preferable to a single general interface
Objects can be replaced at any time by instances of derived classes without affecting
the functionality
A class has only one responsibility
What does System Hungarian Notation entail? Choose an option:
None of the mentioned options *
Enter the names of the variables in the form of a question
The module from which the variables come in their name is introduced
Enter the type of variables in their name
What is the principle of SRP (Single Responsibility Principle) based on? Choose an option:
All the above options
A class must always have only one responsibility and only one
A class must be open for extensions and closed for changes
None of the above
The DRY principle is violated when:
Choose an option:
We write methods that are not necessary
Two methods are written that do the same work
A class has only one responsibility
Objects are replaced with instances of derived classes
What is the Single Responsibility Principle? Choose an option:
A class can only be called once
A class must be written by only one person
A class can only have one court
A class must always have only one responsibility and only one ^
What does the open-closed principle refer to? Choose an option:
Open for changes, closed for extensions
Open for extensions, closed for changes
None of the above
Open for modifying and adding interfaces, closed for extensions
The naming convention in which the date type of the variable is mentioned is:
Choose an option:
It does n't exist
Upper camei case
Lower camei case
Hungarian Notation
What Clean Code rules apply within conditional structures? Choose an option:
Direct instantiation of Boolean variables
Avoid comparisons with true and false
All variants
Use of the ternary operator whenever possible
What does the Open-dosed (OCP) principle entail? Choose an option:
It is also known as Design By Contract
Any change in specifications leads to the uselessness of the class and the rewriting of the
entire code
Classes must be open for extensions, but still closed for modification ^ * '
A class must always have only one responsibility and only one
An example of a class named after the UpperCamelCase naming convention is: Choose an
option:
passport person
passportPerson
passportLegal person
PassportPersonany
L of SOLID represents:
Choose an option:
Liskov inversion
Liskov responsibility
Liskov substitution
Liskov segregation
The rules of Clean Code in the comments are:
Choose an option:
The well-written code is self-explanatory
Use comments to apologize
All variants
No variant
Which of the statements is correct? Choose an option:
functions should not have more than 3 arguments ^
functions should do more things
comments are written to prove a point of view
the class name should be a verb
Which of the following variables respects naming conventions? Choose an option:
float query Performed;
boolean temperatureCamera = true;
boolean is Present = true
int insertvarsta;
What is the violation of the KISS principle?
Choose an option:
In writing methods that are not necessary
In copying pieces of code and integrating them into multiple areas of an application
In writing multi -purpose methods
None of the above
What clean code rules are used to write comments? Choose an option:
Using comments for libraries that will be reused by other programmers (doc comments) or for
TODO comments
Commenting unused code
Using comments to make a method readable
Using introductory comment blocks
What does the Liskov Substitution principle entail? Choose an option:
Classes must be open for extensions, but still closed for changes;
Multiple customizable interfaces are always preferable to a single general interface ;
Objects should not be forced to implement methods that are not useful;
Objects can be replaced at any time with instances of derived classes without affecting
the functionality /
When is the KISS principle applicable? Choose an option:
Whenever we write methods that are not necessary yet;
Whenever we want a method to do everything /
Whenever we give Copy / Paste to a piece of code;
Every time we write two methods that do the same thing;
What is one way to break the KISS (Keep It Simple and Stupid) principle? Choose an option:
Writing methods are not necessary
One method performs multiple tasks /
Copy / paste some pieces of code
Several methods are written that perform the same task
KISS (Keep it simple and stupid) is violated when you choose an option:
one method has too much functionality /
several functions do the same thing
we repeat the code
What is Automatic Testing (Unit Testing)? Choose an option:
The procedure that requires that any piece of written code be reviewed by another programmer;
The technique by which programmers work in pairs for complex tasks to avoid code review;
Rewriting the code in a way that better adapts to the new specifications;
Automatic code testing based on use cases /
Which of the following is not a naming convention? Choose an option:
Hungarian Notation System ;
UpperCamelCase;
Apps Hungarian Notatiorx
CapitalizationCamelCase;
When is the use of comments indicated? Choose an option:
ToDo comment ^
For pieces of unused code
At the end of a method
At the beginning of a method
What does Bad Code mean? Choose an option:
The code breaks when modified;
Hard to read and understand code ;
The code has dependencies in many external modules ;
All options are correct /
Comments Choose an option:
They are indicated only if they are of type TOD ^
They should be used to explain what functions do
There must be many in the code
They are used for apologies
What does the word Open refer to in the Open-Closed principle? Choose an option:
Open for substitution
No option is correct
Open for extension
Open for modification
Test Case is:
Choose an option:
O a. No correct answer
O b. A test run tool
c. A class that defines the set of objects (fixture) to run multiple tests ^
O d. A collection of test cases
In what forms is WhiteBox Testing also known? Choose an option:
© a. All variant ^
b.Clear Box Testing
c) Structural Testing
d) Open Box Testing
What are the advantages of unit tests? Choose an option:
© a. All variant ^
b) test suite can be defined
c. respect the write once, use many times principle
d. can be written ad-hoc as needed
Which of the following are types of testing? Choose an option:
BlackBox Testing;
b) WhiteBox Testing;
c) Integration Testing;
© d. All variants ^
Which of the following statements about jUnit is false? Choose an option:
It is a framework that allows the realization and running of tests for different methods within
the developed projects .
© b. XUnit is an adaptation to jUni ^
c. JUnit works according to two design patterns: Composite and Command.
d. jUnit is the most used framework for unit testing of code written in JAVA.
According to which Design Patterns does JUnit work? Choose an option:
Interpreter & amp; Iterator
b) Composite & amp; Interpreter
c. Bridge & amp; The Builder
© d Composite & amp; Command
Fixture represents: Choose an option:
A method / step for defining the set of objects used prior to testing A
b. A tool for displaying results
O c. A class that defines the set of objects
@ d. A set of objects used in the text ^
What is Teardown? Choose an option:
O a. A set of objects used in the test;
A tool for running tests (test suites) and displaying results;
A method / step of defining the set of objects used (fixture), before testing;
A method / stage of destruction of objects (fixture) after completion of tests
How has the annotation @Before changed from JUnit4 to JUnit5 - Jupiter? Choose an option:
O a. @BeforeEverything
© b. @BeforeEac h
c. @BeforeAII
O d. It hasn't changed
What is a Test Runner? Choose an option:
® a. Test running tool /
b. The class that defines the set of objects to run multiple tests
c. A method of destroying objects after running tests O
d. Set of objects used in the test
Open Box testing is also known as: Choose an option:
O a. Recovery Testing O a
b BlackBox Testing
© c. WhiteBox Testing O
d. No answer
Which of the following is an annotation for the structure of a JUnit5-Jupiter test? Choose an
option:
A @BeforeClass
b. @AfterClass;
c @AfterEach; ????
d. @After;
WhiteBox testing is also known as: Choose an option:
a. Structural testing O
b) Open Box Testing O
c) Glass Box Testing
d. All answers are correct ^
Which of the following is an advantage of BlackBox testing? Choose an option:
The tests are performed from the user 's point of view ^ /
The tests will have a small number of entries
The tests may be redundant with other tests performed by the developer
The tester does not have the application specifications
Which of the following is an annotation used in jUnit4 for automatic skeleton methods?
Choose an option:
a. @ Before /
b. @SetUpBefore.
c. @AfterClass.
d. setllpBeforeClass ().
BlackBox testing is also called:
Choose an option:
Glass Box Testing
Behavioral testing ^
Open Box Testing
Structural testing
During BlackBox testing, the tester knows: Choose an option:
Internal architecture of the tested application
Advanced programming techniques
Application input and output data ^
Number of bugs in the application code
What is the equivalent of annotating @Before from JUnit4 to JUnit5-Jupiter? Choose an option:
a. @BeforeClass;
b. @BeforeEac h
c. @BeforeAII;
d. None of the variants is correct;
Which of the following are features of JUnit? Choose an option:
a. It is a framework that allows the realization and running of tests for different methods within
the developed projects ;
b. All variants are correct ^
c. JUnit works according to two design patterns: Composite and Command;
d. It is the most used framework for unit testing of code written in JAVA;
What method is the @BeforeClass annotation used for? Choose an option:
The tearDown ( ) method ;
The b method tearDownAfterClass (); A
c) setUp () method;
® d. SetUpBeforeClassț method ^
Which statement is correct about unit tests? Choose an option:
® a. Based on them test collections can be defined ^
b. Does not influence the number of bugs in the delivered or integrated code
c. Hard to write
d. They can be run only once
What is the annotation used in JUnit4 for the tearDownAfterClassO automatic skeleton method?
Choose an option:
a. @BeforeClass
b. @Before
c. @ AfterClas ^
d. @After
Which of the following are reasons to use unit tests? Choose an option:
a. Reduce the time lost for debugging and finding bugs;
© b. All variants are correct ^
c. The tests are easy to write;
d. Tests can be run automatically whenever needed;
What is the advantage of WhiteBox testing? Choose an option:
a. It is performed from the user's perspective
b. It does not require knowledge of the input and output data of the application
c. It can be performed at a stage prior to the commissioning of the application /
d. Does not require in-depth programming knowledge
What is Test Case? Choose an option:
A class that defines the set of objects (fixture) to run multiple tests /
A tool for running tests (test suites) and displaying results;
A collection of test cases;
d. A set of objects used in the test;
What is BlackBox Testing? Choose an option:
Testers do not know the internal architecture of the tested application
© b. All variant ^
c. The tester knows only the input data and the output data of the application d. It is also called
behavioral testing
What is the concept of Setup? Choose an option:
A class that defines the set of objects (Fixture) to run multiple tests
A method / step of defining the set of objects used (Fixture) before testing
A method / stage of destroying objects (Fixture) after completion of tests d. A set of objects used
in the test
What is fixture? Choose an option:
A a. Test running tool
b. collection of test cases
c. the class that defines the set of objects to run multiple tests
® d. Set of objects used in the text ^
What is Teardown? Choose an option:
O a. It is a test running tool.
It is a method of destroying objects after testing
It is a method of creating new objects after completing the tests.
It is a class that defines a set of objects to run multiple tests.
Which of the following information about BlackBox Testing is true? Choose an option:
© a. The tests are performed from the user 's point of view ^ /
b. It is also known as Transparent Box Testing
c. The interface does not have to wait for the test to be performed
d. The tests will have a large number of entries
What is fixture? Choose an option:
The method of defining the set of objects used before testing
A method of destroying objects after running tests
c. Collection of test cases
® d. Set of objects used in the text t
Which of the following annotations for the structure of a test is not present in JUnit 4? Choose an
option:
a. Before
b AfterClass
c) AfterEac h
d BeforeClass
What is testing? Choose an option:
a. None of the variants
b. It is used to signal the presence of defects
c. Guarantees the absence of defects
d. The process of modifying errors and defects
Regarding the BlackBox Testing, the following option is correct . Choose an option:
a) No variant
b. All variants ^
c. It is a method used to test the software application by people who do not know the internal
architecture of the tested application
d. The tester knows only the input data and the output data of the application
a) Inverse relationship
b) Conformance
c) Cross-check
d) Error condition
Implement the Product class that contains the quantity attribute. The attribute accepts values
between 5 and 100 (including these 2 values). To allow customers to change the product
quantity, implement the setQuantity (int value) method. The method should validate the input
value. If you are implementing the following test, what values should you use for "X" if the test
is a BOUNDARY type? Choose one or more options. testSetQuantity ()
a) 6
b) 5
c) 100
d) 4
e) 99
f) 101
Implement the Product class that contains the quantity attribute. The attribute accepts values
between 5 and 100 (including these 2 values). To allow customers to change the product
quantity, implement the setQuantity (int value) method. The method should validate the input
value. If you are implementing the following test, what values should you use for "X" if the test
is a RIGHT test? Choose one or more options. testSetQuantity ()
a) 4
b) 101
c) 5 ????
d) 6
e) 100 ???
f) 99
If we test the isFibonacciNumber () method with the value 8 and obtain the TRUE result, we
perform a ____________ type test (choose the correct option) perfectSquare
a) Error condition
b) Performance
c) Cross check
d) R ight ????
To perform an Error conditions test for the isFibonacciNumber () method, we must use the
value testSetQuantity ()
a) 4 ????
b) 0 ???
c) 3
d) 2
e) 1
For a RIGHT test, if we call the next method with the value 4 (where 4 represents an index), do
we expect to receive the value? getFibonacciNumber
a) Right ???
b) Cross check
c) Error condition
d) P erformance
Given the next implementation. What Clean Code principles (choose one or more) have been
used here? perfectSquare
If you want to create a solution that allows you to use a single instance for a class so that the
resource / event is managed centrally, the most appropriate GoF pattern is?
Choose an option:
a. Singleton
b) State
c) Memento
d) Proxy
e. Prototype
A smart-home system, with different sensors installed in the house, requires the implementation
of a mobile solution, for different platforms, that will receive messages from available sensors
and trigger different notifications on the client GUI. What is the right design pattern for this
functionality:
Choose an option:
a. Facade ???
b. Singleton
c. States
d) Observer ???
e. Adapter
f. Strategy
??????????? What are some of the benefits of unit testing?
Choose one or more options:
Can improve the design of code, especially if using Test Driven Development (TDD)
b) Makes it easier to change / refactor code.
c) Reduces the level of bugs in production code.
d) Simplifies integration testing
e. Unit tests are a form of documentation.
What's the correct difference between an Adapter pattern and a Decorator?
Choose an option:
The Adapter is Structural, and Decorator is Creational
b) There are no differences between the two concepts, Decorator being an alias for the Adapter
c) Adapter is used to modify the functionality of an existing class and Decorator adds new
properties
d) The Adapter does not add new functionality, but Decorator extends the functionality of the
object
An image viewer application that supports various formats (jpeg, gif, bmp, etc.) is required. The
application can be extended to generate other formats in the future. What is the right pattern
design that will help you manage future development efficiently:
Factory
The following scenario is considered.
You develop an online solution for a company that offers for rent to its customers different
vehicles categories: cars, motorcycles and vans.
Fleet structure data is stored uniquely at solution level and can be queried by clients.
Clients can check the details for each vehicle. The component that delivers this description
presents for each selected vehicle details depending on the state in which it may be: defective,
available or rented.
What design patterns (one or more) are suitable to be used to implement the presented scenario.
Choose one or more options:
a. Composite
b) Strategy
c. Builder
d. Factory
e Flyweight
f. State
g. Singleton
If you want to create a solution that allows you to use a single instance for a class so that the
resource / event is managed centrally, the most appropriate GoF pattern is?
Choose an option:
a. State
b) Proxy
c) Prototype
d) Memento
e. Singleton
The following scenario is considered. A company produces shirts and sell them
online. Following a customer survey, the company decided to add additional items such as the
customer’s monogram, color, size, branding, etc. What design pattern should be implemented to
allow customers to customize their shirts design before ordering them?
Choose an option:
a. Builder
b) Strategy
c) Facade
d . Decorator ????
e. Adapter
If you want to implement a solution where all clients that use Class A will have access to the
same type A instance, what GoF pattern will you use?
Choose an option:
There is no need for pattern because the solution is implemented by marking Class A as final
b) Memento is implemented for Class A
c) Flyweight is implemented for Class A
d. Singleton is implemented for Class A
e) There is no need for pattern because the solution is implemented by defining class A as
abstract
For the security of a cloud application, it is wanted that when a user logs on, on the server side is
generated one instance of the component, so that it has only one active session. What is the right
pattern design?
Choose an option:
a. Singleton
b) Facade
c. Factory
d) Observer
e. Adapter
f. Proxy
What pattern allows you to extend / change the object functionality at run-time?
Choose an option:
a.Adapter
b) Strategy
c. Decorator
d) State
e. Facade
f Composite
An image viewer application that supports various formats (jpeg, gif, bmp, etc.) is required. The
application can be extended to generate other formats in the future. What is the right pattern
design that will help you manage future development efficiently:
Choose an option:
a. Singleton
b) Facade
c) Adapter
d. Factory
e) Observer
???? A web hosting company offers different plans for server rental (standard, professional and
premium). Different hosting services (cloud, SSL, 24/7 support, backup, databases, etc.) can be
added to each plan after the contract has been signed and the service started. What is the design
pattern for implementing an IT solution for order management:
Choose an option:
a.Adapter
b) Factory
c) Facade
d. Singleton
e. Decorator
Which of the following concepts is NOT a mandatory component used in defining a design
pattern?
Choose an option:
a) Pattern name
b) The solution provided by the pattern described by diagrams or pseudo-code
c) Implementing the pattern in Java
d) The advantages and disadvantages of the pattern
e) The problem for which the pattern offers a solution
????
What GoF pattern must be implemented if you want to implement a solution that allows the
client to choose at run-time the algorithm / function needed to process a data set. The solution
must allow the modification of the function library but not of the class that manages the data
Choose an option:
a. Decorator
b) Facade
c) Strategy
d) Adapter
e. State
f. Wrapper
Which of the following patterns are Structural (choose one or more right answers)?
Choose one or more options:
a.Adapter
b) Proxy
c. Builder
d) State
e. Decorator
f. Singleton
g Facade
h. Factory
What is a DISADVANTAGE for the Singleton pattern?
Choose an option:
In some situations, a bottleneck for communication or access to resources
b) Centralized management of a resource through a single instance
c Does not allow duplication of instances
d) Strict control of instancing a class - only once ?
e) Allows the creation of a single object
The following scenario is considered. A printing company makes wedding invitations. The
company owns a set of a number of templates used to make subsequent personalized
invitations. What design pattern is recommended to use to optimize the consumption of resources
on memory storage of used objects?
Choose an option:
a. Builder
b) Prototype
c) Strategy
d) Flyweight
e Composite
f. Singleton
g Abstract factory
The following scenario is considered: ACME Inc. develops a software solution for a restaurant
so that the waiter can take orders directly on the mobile phone.
The orders are taken from the client and they are created on the spot, being automatically
assigned to the specialized chef on that dish, the ingredients used and other special requirements
of the client.
These details are provided by the application, without the need for the intervention of the waiter
who only selects the required dish. The orders are sent to the chefs at the end of the order for the
respective table, and will be executed according to the degree of load of each chef. What pattern
offers a solution to this problem?
Choose an option:
a. State
b) Composite
c) Command
d) Memento
e) Chain of Responsibility
If you want to implement a solution where complex objects are built by a mechanism
independent of the actual object making process, so that the client does not know the internal
details of the object, the most suitable GoF pattern is
Choose an option:
a. Builder
b) Factory
c. Decorator
d. Singleton
e. Adapter
Your domain contains 3 classes: Enemy, BigEnemy, SmallEnemy. They have the same public
methods. If you create just a SmallEnemy AND NO OTHER TYPE OF ENEMY, how will you
name a variable which stores a reference to a new instance?
Choose an option:
a. smlEmy
b. e
c.smallEnemy
d) enemy
???? What means "technical debt" in software development
Choose an option:
The level of technical knowledge that software developers lack
b) The future cost of fixing bugs created now
c) The value that exceeds the project budget
d) The difference between different technologies used in the development phase
e) The value that the client should pay for new features, which are added before release
TEST GRIDS
The following class hierarchy applies the principle:
If the following function is considered, indicate with what values a unit test of type Cardinality =
0 can be implemented ?
a) arrayList <Integer> input = new ArrayList <> ()
Given the function for calculating the price of a ticket and the following restrictions:
Zone takes values in set {1,2,3}
The basic price is positive but less than
1000
Indicate which of the method parameters can be used for an Order type test?
Given the function for calculating the price of a ticket and the following restrictions:
Zone takes values in set {1,2,3}
The basic price is positive but less than
1000
Indicate which of the following unit tests are considered Boundary for the area?
?????
calculPretBilet (3,700, true)
calculPretBilet ( 2 , 5 00, true)
calculPretBilet ( 0 , 700, true)
calculPretBilet ( 1 , 5 00, false )
calculPretBilet ( 2 , 1 00, false )
calculPretBilet ( 4 , 7 00, false)
Given the function for calculating the price of a ticket, indicate the minimum number of unit
tests (with different combinations of values) that must be implemented to ensure a 100% code
coverage? ?????????
Barrier
Email email group
Bitmap children
Glovo / food panda food
Students' school situations remain the coordinating teacher
Given the following diagram that represents a solution that implements a Design Patter, indicate
which one it is? Facade http://gloriahuston.org/dp/
Given the following diagram that represents a solution that implements a Design Patter, indicate
which one it is? Command http://gloriahuston.org/dp/
Given the next class date, select statements (one or more) that describe it correctly
Database Connection
b) ???? i) ????