1.
Koje tvrdnje su tacne?
Correct Answer(s)
A. Metoda bele kutije je kada imamo izvorni kod programa za koji treba da napisemo test
D. Metoda crne kutije je kada imamo samo dokumentaciju koja opisuje ponasanje programa za koji treba da napisemo test
Explanation
The correct answer states that "Metoda bele kutije je kada imamo izvorni kod programa za koji treba da napišemo test" (White box method is when we have the source code of the program for which we need to write a test) and "Metoda crne kutije je kada imamo samo dokumentaciju koja opisuje ponašanje programa za koji treba da napišemo test" (Black box method is when we only have documentation that describes the behavior of the program for which we need to write a test). These statements accurately describe the concepts of white box and black box testing methods, where white box testing involves having access to the internal structure and code of the program, while black box testing relies solely on external behavior and specifications.
2.
Koja je anotacija za metod u test klasi kojom ukazujemo da metod predstavlja jedinicni test?
Correct Answer
A. @Test
Explanation
The correct annotation for a method in a test class that indicates that the method represents a unit test is "@Test". This annotation is commonly used in testing frameworks such as JUnit to identify and execute individual test cases. By using this annotation, the testing framework recognizes the method as a test and includes it in the test suite for execution.
3.
Koja tvrdnja je tacna?
Correct Answer
A. JUnit testovi su primer automatsko testiranja
Explanation
JUnit testovi su primer automatskog testiranja. JUnit je popularan okvir za pisanje i izvršavanje testova u programskom jeziku Java. Testovi napisani u JUnitu se automatski izvršavaju, bez potrebe za ručnim intervencijama. Ovaj okvir omogućava programerima da definišu testove koji proveravaju ispravnost funkcionalnosti njihovog koda. Automatsko testiranje pomaže u otkrivanju grešaka i olakšava proces razvoja softvera, jer se testovi mogu izvršavati brzo i ponavljati neograničen broj puta.
4.
Koja je verzija JUnit biblioteke koju koristimo za pisanje testova na ovom predmetu?
Correct Answer
A. 5
Explanation
The correct answer is 5 because it is the version of the JUnit library that is used for writing tests in this subject.
5.
Kako se zove biblioteka koju koristimo za pisanje jedinicnih testova?
Correct Answer
A. JUnit5
Explanation
JUnit5 is the correct answer because it is a library used for writing unit tests in Java. It provides various features and annotations to facilitate the writing and execution of unit tests. JUnit4 is also a popular unit testing library, but JUnit5 is the newer version with additional features and improvements. Bash script and "Nijedno od navedenog" (None of the above) are not relevant to unit testing in Java, so they are not the correct answers.
6.
Na koji nacin u Java programu ispisujemo neki podatak na standardni izlaz?
Correct Answer(s)
A. System.out.print
B. System.out.println
C. System.out.printf
Explanation
In a Java program, we can use the methods System.out.print, System.out.println, and System.out.printf to display data on the standard output. These methods are provided by the System class in Java and allow us to print text or values to the console. The echo and print options are not valid methods in Java for printing to the standard output. Similarly, there is no method called System.output.
7.
Koja je precica za generisanje komponenata klase u IntelliJ IDEA razvojnom okruzenju?
Correct Answer
A. Alt+Insert
Explanation
The shortcut Alt+Insert is used to generate class components in IntelliJ IDEA development environment.
8.
Koja tvrdnja je tacna?
Correct Answer
A. Svaka klasa treba da ima minimum jedan test koji se uz nju isporucuje i koji proverava njenu funkcionalnost
Explanation
The correct answer is that every class should have at least one test that is delivered with it and checks its functionality. This means that it is important for each class to have a test that ensures its functionality is working correctly. This helps to identify any potential errors or issues with the class and allows for proper testing and verification of its functionality.
9.
Kako se zove razvojno okruzenje koje koristimo na vezbama iz ovog predmeta?
Correct Answer
A. IntelliJ IDEA
Explanation
IntelliJ IDEA is the correct answer because it is the development environment used in exercises for this subject.
10.
Koja je precica za popup meni u kojem je dostupna opcija za generisanje testa kada je selektovano ime klase?
Correct Answer
A. Alt+Enter
Explanation
The correct answer is Alt+Enter. This keyboard shortcut is commonly used in programming environments, such as IDEs, to access a popup menu that provides various options and suggestions related to the selected code. In this specific case, when the class name is selected, pressing Alt+Enter would open a popup menu that includes the option to generate a test.
11.
Kada testiramo realne vrednosti, koristimo assertEquals metod koji ima 3 argumenta, od kojih je poslednji:
Correct Answer
A. Delta
Explanation
When testing real values, the assertEquals method is used with three arguments. The last argument, "delta," is used to specify the maximum allowed difference between the expected and actual values. This means that the test will pass as long as the difference between the expected and actual values is within the specified delta range.
12.
Kada radimo sa testiranjem realnih vrednosti, o cemu moramo da vodimo racuna?
Correct Answer
A. O tome da relani brojei, zbog nacina binarnog zapisa, mogu da budu pogresno zaokruzeni
Explanation
When working with testing real values, it is important to consider that real numbers can be inaccurately rounded due to the binary representation method. This means that the representation of real numbers in binary can introduce rounding errors, leading to potential inaccuracies in calculations and comparisons.
13.
Metoda crne kutije podrazumeva...
Correct Answer
A. Da nemamo dostupan kod, nego samo dokumentaciju
Explanation
The correct answer is that the black box method assumes that we do not have access to the code, but only to the documentation. This means that we can only interact with the software or system based on its inputs and outputs, without any knowledge of its internal workings.
14.
Ako u dokumenaciji pise da metod prihvata samo vrednosti manje od 10, dok sve vece setuje na 10, koliko jedinicnih testova treba da napisemo da bismo testirali ispravnost takvog metoda?
Correct Answer
A. 2
Explanation
If the documentation states that the method only accepts values less than 10 and sets any larger values to 10, we need to write two unit tests to test the correctness of such a method. One test should pass a value less than 10 and verify that it remains unchanged, while the other test should pass a value greater than or equal to 10 and verify that it is set to 10. These two tests cover both scenarios and ensure that the method behaves correctly according to the documentation.
15.
Koja tvrdnja je tacna?
Correct Answer
A. JUnit testovi su primer automatskog testiranja
Explanation
JUnit testovi su primer automatskog testiranja zato što JUnit je framework za pisanje i izvršavanje automatskih testova u programskom jeziku Java. Automatsko testiranje se odnosi na izvršavanje testova bez intervencije korisnika, što je upravo ono što JUnit testovi omogućavaju. Ovi testovi se mogu automatizovano pokretati i ponavljati kako bi se proverila ispravnost koda i otkrile potencijalne greške. Manuelno testiranje, s druge strane, zahteva ručno izvršavanje testova od strane korisnika, što nije slučaj sa JUnit testovima.
16.
Kada radimo testiranje celobrojnih vrednosti, o cemu moramo da vodimo racuna?
Correct Answer
C. Ne moramo ni o cemu posebno da vodimo racuna kada radimo sa celobrojnim vrednostima
Explanation
When performing testing on integer values, we don't need to take any special precautions. This means that we don't need to worry about any specific issues or considerations when working with integer values.
17.
Kojom anotacijom u JUnit5 obelezavamo pojedinacne jedinicne testove?
Correct Answer
A. @Test
Explanation
The correct answer is "@Test". In JUnit5, we use the "@Test" annotation to mark individual unit tests. This annotation tells the JUnit framework that the annotated method is a test method. By marking the method with this annotation, we can easily identify and execute the unit tests during the testing process. The other options mentioned, "@Tests" and "Ne obelezavamo jedinicne testove" are not valid annotations in JUnit5 for marking unit tests.
18.
Da li black box tehnika podrazumeva da radimo Coverage testove?
Correct Answer
A. Ne, zato sto nemamo izvorni kod ciji coverage bismo proveravali
Explanation
The correct answer is "Ne, zato sto nemamo izvorni kod ciji coverage bismo proveravali" which translates to "No, because we do not have the source code whose coverage we would check." This answer explains that black box testing does not involve coverage testing because it focuses on testing the functionality of the software without considering the internal structure or code. Since black box testing does not require the knowledge of the source code, coverage testing is not a part of it.
19.
Da li ima potrebe posebno testirati konstruktor klase ako je jedini konstruktor te klase?
Correct Answer
A. Ne, zato sto ce taj konstruktor svakako biti pozvan za kreiranje objekata koji se koriste u pojedinacnim testovima
Explanation
The explanation for the given correct answer is that there is no need to specifically test the constructor of a class if it is the only constructor because it will be automatically called when creating objects used in individual tests. Therefore, testing the constructor separately would be redundant and unnecessary.
20.
Koja od navedenih imena nisu u skladu sa konvencijom imenovanja?
Correct Answer(s)
C. PrintUsername_WillPrintTheUsernameParameter
D. PrintFullName_WillPrintTheUsersFullName
Explanation
The correct answer is "printUsername_WillPrintTheUsernameParameter, printFullName_WillPrintTheUsersFullName." These names are not in accordance with naming conventions because they use underscores (_) to separate words instead of using camel case. In camel case, the first letter of each word is capitalized except for the first word. The correct names should be "printUsernameShouldPrintTheUsernameParameter" and "printFullNameShouldPrintTheUsersFullName."
21.
Na koji nacin mozemo da ukljucimo spoljasnje biblioteke u projekat?
Correct Answer(s)
A. Ukljucivanjem JAR arhivirane biblioteke
B. Ukljucivanjem biblioteke sa Maven repozitorijuma
Explanation
We can include external libraries in a project by either including a JAR archived library or by including a library from the Maven repository.
22.
Koje od navedenih imena metoda nije u skladu sa konencijom imenovanja?
Correct Answer
A. IsSystemGood_MustReturnFalse_IfTheSystemIsWindows
Explanation
The method name "isSystemGood_MustReturnFalse_IfTheSystemIsWindows" is not in accordance with naming conventions because it includes unnecessary details about the expected return value and the specific condition. A better name would be "isSystemWindows" or "isWindowsSystemGood".
23.
Koja od navedenih imena metoda nisu u skladu sa konvencijom imenovanja?
Correct Answer(s)
C. IsVisible_MustReturnTrue_IfPageHasAttributeVisibleSetTo1
D. IsVisible_MustReturnFalse_IfPageHasAttributeVisibleSetTo0
Explanation
The correct answer is "isVisible_MustReturnTrue_IfPageHasAttributeVisibleSetTo1" and "isVisible_MustReturnFalse_IfPageHasAttributeVisibleSetTo0". These method names do not follow the naming convention because they use "Must" instead of "Should" in the naming. The convention typically suggests using "Should" for method names that describe expected behavior, while "Must" implies a requirement or obligation.
24.
Koja tvrdnja je tacna?
Correct Answer
A. Testiranje metodom crne kutije podrazumeva da obavezno kazemo programerima u kojem metodu je najverovatnije greska
Explanation
Testiranje metodom crne kutije podrazumeva da obavezno kazemo programerima u kojem metodu je najverovatnije greska. This answer suggests that in black box testing, it is necessary to inform the programmers about the method in which the error is most likely to be found. This helps the programmers to focus their debugging efforts on that specific method and increases the efficiency of the testing process.
25.
Koje od navedenih imena metoda nije u skladu sa konvencijom imenovanja?
Correct Answer
A. Pozdravi_ShouldTrowLanguageNotSupportedException_WhenTheLanguageIsNotSupported
Explanation
The method name "pozdravi_ShouldTrowLanguageNotSupportedException_WhenTheLanguageIsNotSupported" is not in accordance with the naming convention because it contains a typo. The word "Throw" is misspelled as "Trow".
26.
Koje od navedenih imena metoda nije u skladu sa konvencijom imenovanja?
Correct Answer
A. Pozdravi_ReturnsGreetingInSerbian_IfTheLanguageIsSerbian
Explanation
The correct answer is "pozdravi_ReturnsGreetingInSerbian_IfTheLanguageIsSerbian" because it does not follow the naming convention. In the convention, method names should be written in camel case, starting with a lowercase letter, and should be descriptive of the action they perform.
27.
Koja tvrdnja je tacna?
Correct Answer
A. Kada pravimo testove, treba da paket u kojem su klase projekta nazovemo isto kao paket u kojem su klase koje testiramo
Explanation
When creating tests, it is recommended to name the package containing the project classes the same as the package containing the classes being tested.
28.
Koja tvrdnja je tacna?
Correct Answer
A. Prilikom testiranja metodom crne kutije, pisemo testove samo za metode koje su dokumentovane, cak iako postoje druge koje nisu
Explanation
The correct answer states that during black-box testing, tests are only written for documented methods, even if there are other methods that are not documented. This means that the focus is on testing the functionality of the documented methods while disregarding any undocumented methods.
29.
Kako se zove paket u kojem je JUnit5 biblioteka klasa koju preuzimamo pomocu Maven package manager alata sa repoziturijuma?
Correct Answer
A. Org.junit.jupiter
Explanation
The correct answer is org.junit.jupiter. This is the correct package name for the JUnit5 library that is downloaded using the Maven package manager tool from the repository.
30.
Kada je izvor parametara nekog parametarizovanog testa metod, on treba da vrati rezultat kog tipa?
Correct Answer
A. Stream <Arguments>
Explanation
The correct answer is Stream . This is because when the source of parameters for a parameterized test method is a Stream, it should return a Stream of Arguments. The other options, such as Stream , Streams , Streams , Stream , and Streams do not accurately represent the type of result that should be returned in this scenario.
31.
Kojom anotacijom za parametarizovani metod definisemo da je izvor njegovih argumenata neki drugi metod?
Correct Answer
A. @MethodSource
Explanation
The correct answer is @MethodSource. This annotation is used to define that the source of arguments for a parameterized method is another method.
32.
Kojom anotacijom obelezavamo parametarizovani test?
Correct Answer
A. @ParameterizedTest
Explanation
The correct answer is @ParameterizedTest. This annotation is used to mark a parameterized test in Java. Parameterized tests allow us to run the same test multiple times with different input values. By using this annotation, we can easily provide different sets of parameter values to our test method.
33.
Kada je klasa napravljena koriscenjem Singleton Design Pattern-a, kako se najcesce zove staticka konstruktorska funkcija objekta takve klase?
Correct Answer
A. GetInstance
Explanation
When a class is created using the Singleton Design Pattern, the most common name for the static constructor function of an object of that class is "getInstance". This function is responsible for returning the instance of the class, ensuring that only one instance is created and providing global access to it.
34.
Pomocu kog staticnog metoda Arguments klase kreiramo Arguments objekat sa vise od jednog objekta u spisku argumenata?
Correct Answer
A. Of
Explanation
The correct answer is "of".
35.
Pomocu kog staticnog metoda Stream klase kreiramo tok od vise od jednog objekta?
Correct Answer
A. Of
Explanation
The correct answer is "of". The static method "of" in the Stream class is used to create a stream from multiple objects. It takes a variable number of arguments and returns a stream consisting of those objects. This allows us to easily create a stream with more than one object without having to manually add each object to the stream.
36.
U metode crne kutije spadaju:
Correct Answer(s)
A. Testiranje granicnih vrednosti
C. Podela na klase ekvivalencije
Explanation
The correct answer is "Testiranje granicnih vrednosti" and "Podela na klase ekvivalencije". These two methods are commonly used in black box testing. Testiranje granicnih vrednosti, also known as boundary value testing, involves testing the boundaries or limits of input values to ensure that the system behaves correctly. Podela na klase ekvivalencije, or equivalence partitioning, involves dividing the input data into groups or classes that are expected to exhibit similar behavior. By testing representative values from each class, we can ensure that the system handles different inputs correctly.
37.
Na osnovu uzrocno posledicnog grafa pravi se:
Correct Answer
A. Tabela odlucivanja
Explanation
Based on the causal graph, a decision table is created. A causal graph represents the cause-and-effect relationships between different variables or factors. In this case, the graph suggests that a decision table is the appropriate tool to capture and analyze the relationships between various factors and their corresponding decisions. A decision table helps in organizing and evaluating different combinations of conditions and actions, ultimately aiding in decision-making processes.
38.
Kako se dizajniraju testovi?
Correct Answer
C. Pazljivo se planiraju i dizajniraju
Explanation
The correct answer is "Pazljivo se planiraju i dizajniraju" which means "They are carefully planned and designed" in English. This answer suggests that the process of designing tests requires careful planning and consideration. It implies that tests are not chosen randomly or by testing all combinations of input data, but rather they are thoughtfully planned and designed to ensure effective and efficient testing.
39.
Ukoliko je uslov da neka ulazna velicina bude celobrojna u rasponu 1-10, koliko klasa ekvivalencije postoji ukupno:
Correct Answer
A. 3
Explanation
The question is asking for the total number of equivalence classes when the condition is that the input size must be an integer in the range of 1-10. The correct answer is 3 because there are three possible equivalence classes: one for inputs less than 1, one for inputs between 1 and 10 (inclusive), and one for inputs greater than 10.
40.
U testiranju podelom na klase ekvivalencije, sve vrednosti unutar iste klase ce:
Correct Answer(s)
B. Proivesti isti rezultat
C. Pronaci iste greske
Explanation
When testing using equivalence partitioning, all values within the same class will produce the same result and identify the same errors. This is because equivalence partitioning involves dividing the input values into groups or classes that are expected to behave in the same way. By testing a representative value from each class, we can ensure that the behavior is consistent within that class. Therefore, the correct answer is "Proivesti isti rezultat, Pronaci iste greske."
41.
Cinjenice koje vaze za alfa testiranje:
Correct Answer(s)
A. Simuliraju se stvarni korisnici
B. Izvrsava se u laboratorijskom okruzenju
Explanation
The correct answer is "Simuliraju se stvarni korisnici, Izvrsava se u laboratorijskom okruzenju." This means that during alpha testing, real users are simulated and the testing is carried out in a controlled laboratory environment. This allows for the evaluation of the software's performance and functionality in a controlled setting before it is released to the actual users. Additionally, during alpha testing, users provide feedback on their experience with the software, which helps in identifying any issues or improvements that need to be addressed before the final release.
42.
Otkaz (failure) softverskog sistema je:
Correct Answer
B. Nemogucnost sistema da obavi zahtevanu funkciju
Explanation
The correct answer is "Nemogucnost sistema da obavi zahtevanu funkciju" which translates to "Inability of the system to perform the requested function." This answer suggests that the failure of the software system is due to its inability to carry out the required task or function. It does not mention any specific technical issue like a bug in the code or a power outage.
43.
Funkcionalno testiranje je:
Correct Answer(s)
B. Bazirano na specifikaciji sistema
C. Metoda crne kutije
Explanation
Funkcionalno testiranje je metoda crne kutije bazirana na specifikaciji sistema. To znači da se testiranje fokusira na provjeru da li sistem ispunjava specifikacije i zahtjeve korisnika, a ne na detalje implementacije ili strukturu koda. Ova metoda se koristi za testiranje funkcionalnosti sistema, provjeru da li sistem radi ispravno i da li zadovoljava očekivane funkcionalne zahtjeve.
44.
Reprezentacija programa u obliku grafa se naziva:
Correct Answer
A. Graf toka kontrole
Explanation
The correct answer is "Graf toka kontrole." This term refers to the representation of a program in the form of a graph, which shows the flow of control within the program. It illustrates the sequence of instructions and the conditions or loops that determine the order of execution. This graph helps in understanding the control flow and can be used for program analysis and optimization.
45.
Koji iskazi su tacni?
Correct Answer(s)
A. Pokrivanje odluka podrazumeva pokrivanje iskaza
C. Pokrivanje putanja podrazumeva pokrivanje iskaza
Explanation
The correct answer is "Pokrivanje odluka podrazumeva pokrivanje iskaza" and "Pokrivanje putanja podrazumeva pokrivanje iskaza." This means that covering decisions and covering paths both involve covering statements.
46.
Strukturno testiranje se naziva jos:
Correct Answer
B. Metod bele kutije
Explanation
The correct answer is "Metod bele kutije" (Method of white box). This term refers to a testing approach where the tester has access to the internal structure and code of the system being tested. It involves testing the internal logic and paths of the application to ensure that all aspects are functioning correctly. This method is also known as white box testing because it allows the tester to see inside the "white box" of the system.
47.
Ciklomatska kompleksnost grafa (V, E), gde je V skup cvorova, a E skup grana, se racuna kao:
Correct Answer
C. CC=E-V+2
Explanation
The correct answer is CC=E-V+2. The cyclomatic complexity of a graph is calculated by subtracting the number of vertices (V) from the number of edges (E) and adding 2. This formula gives the total number of independent paths in the graph, which is a measure of the complexity of the graph.
48.
Kod strukturnog testiranja, testovi se pisu na osnovu:
Correct Answer(s)
B. Detaljnog dizajna sistema
C. Koda
Explanation
In structural testing, tests are written based on the detailed design of the system and the code. This means that the tests are created by examining the specific design of the system and the actual code implementation. By focusing on the detailed design and the code, structural testing aims to ensure that the individual components and their interactions are thoroughly tested, leading to a more comprehensive assessment of the system's functionality and performance.
49.
Kod pokrivanja odluka:
Correct Answer
B. Svaka izlazna grana uslovnih iskaza mora biti izvrsena bar jednom
Explanation
The explanation for the given correct answer is that in the coverage of decisions, it is necessary for every conditional statement's output branch to be executed at least once. This ensures that all possible outcomes of the decision are tested and accounted for. If any branch is not executed, there may be potential paths or scenarios that are not being tested, leading to potential errors or untested code. Therefore, it is important to ensure that every branch of a conditional statement is executed at least once for comprehensive decision coverage.
50.
Za graf sa slike odrediti CC:
Correct Answer
B. 5
Explanation
The given answer, 5, is the correct answer for determining the CC (connected components) of the graph shown in the image. This suggests that there are 5 connected components in the graph.