EE461L Midterm Exam #1

Ace your homework & exams now with Quizwiz!

Fill in the blank below so that the Python function expand(x) takes a list of strings, concatenates them, and returns the resulting string repeated three times. Example: Input: ['string1', 'string2'] Output: 'string1string2string1string2string1string2' def expand(x): return ___________

"".join(x)*3

Consider the following from an html file: <div id="hey> <p> Hello! </p> </div> I want the paragraph in this division to have blue text, and for the header to have red text. What should I include in my external CSS file?

#hey p {color:blue;} #hey h1 {color:red;}

Fill in the blanks below to change the color of the text in the element with id="para" to red. <!DOCTYPE html> <html> <head> <style> ________ { ________ } </style> </head> <body> <h1> This is a Heading </h1> <p id="para"> This is a paragraph. </p> <p> This is another paragraph. </p> </body> </html>

#para, color:red;

Which of the following are "smells" (ie. bad things to avoid) in unit testing?

- Test functions that call each other - JUnit tests that have to be run in a particular order - Mutable shared state, ie. two tests that use a shared object

How can you add a comment in JavaScript?

//comment

Consider the following program. public class A { public int fun (int x, boolean cond1, boolean cond2, boolean cond3) { if(cond1) x++; if(cond2) x--; if(cond3) x=x; return x; } } You run two tests. In the first test, x=2 and cond1, cond2, cond3 are all True. In the second test, x=0 and cond1, cond2, cond3 are all False. What percent branch coverage have you achieved?

100%

What is the correct HTML for creating a hyperlink? use "http://www.cnn.com" with title CNN

<a href="http://www.cnn.com">CNN</a>

Which of these does not require a closing tag? <ol> <body> <i> <br>

<br>

Choose the correct HTML element for the largest heading:

<h1>

Which of the following are true about an Ant target? A. A target is a collection of tasks that you want to run as one unit. B. Targets cannot have dependencies on other targets. C. Both A and B D. None of the above

A. ; A target is a collection of tasks that you want to run as one unit

Which of the following is a non-functional requirement? A. The system always responds to user clicks in less than one tenth of a second. B. The system displays a list of hotel vacancies. C. The system notifies the user when a new order arrives. D. The system enables users to place lunch orders. E. None of the other answers are correct

A. The system always responds to user clicks in less than one tenth of a second.

In a use case, an actor is which of the following?

Anything external to the system that acts on the system (human user, device, another system)

True or False: In Python, a variable must be declared before it is assigned a value.

False

Usability is defined by several quality components - one of these is called Learnability. How is Learnability defined?

How easy is it for users to accomplish basic tasks the first time they encounter the design?

Which one of these is appropriate in an agile and iterative development process?

Implement the system incrementally, building it up bit by bit.

What does the "depends" field do in ANT?

It requires a dependency target to be run before running the current target

In Maven, the default value for the <packaging> element is:

JAR

What does a web browser do when you click a hyperlink?

Send an HTTP GET request

Python strings have a property called "immutability." What does this mean?

Strings in Python cannot be changed

What is a "smoke test"?

Subset of full regression testing

Which of the following is a non-functional requirement?

The system always responds to user clicks in less than one tenth of a second

T/F: In test-driven development, each new feature begins with writing a test.

True

True or False: In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type.

True

True or False: In python, a list can contain objects of multiple types.

True

In Python, what is the output of the following program? L = list('123456') L[0] = L[5] = 0 L[3] = L[-2] print(L)

[0, '2', '3', '5', '5', 0]

Object-oriented technology is based on several concepts that, when applied to a design, can make the resulting product easier to extend and reuse. One of these concepts is described as: The process of focusing only on the essential characteristics of an entity. Which OO concept does this describe?

abstraction

In a UML use case diagram, which of the following is true of an extension? An extension:

adds optional behavior to that of another use case

In a UML use case diagram, which of the following is true of an extension? An extension:

adds optional behavior to that of another use case

How do you write "Hello World" in an alert box?

alert("Hello World");

In Maven, which of the following configuration elements are present in the pom.xml file? - project dependencies - plugins - goals - all of the above

all of the above

Which of the following is true about Maven's central repository? - It is a repository provided by the Maven community. - It contains a large number of commonly used libraries. - When Maven does not find a dependency in your local Maven repo, it starts searching the central Maven repository - all of the above

all of the above

Consider the following JUnit method: @Before public void testingStuff() {...} This method will

be run before each and every test method in the class is called

Fill in the blank. Definition of _______ testing: Tests in which the test cannot see the inner workings of the item being executed.

black box

In class, we discussed UML diagrams for both static and behavioral modeling of software systems. Which of the following diagrams are part of a system's static model?

class diagram

The following represent which two relationships in a UML class diagram? 1. diamond filled in arrow 2. diamond empty arrow

composition, aggregation

We are working on a project that includes class A and class B. ________ is increased when any of the following occur: A has an attribute of type B. A has a method with parameter or return value of type B.

coupling

The following describe which relationship in a UML class diagram between class A and class B? - indicates a "using temporarily" relationship - represented with a dotted line - if the relationship is in one direction only, the dotted line has an open arrow on one end - may be used (among other situations) if class A has a member function with an argument of type B

dependency

What is the correct JavaScript syntax to change the content of the HTML element below? <p id="demo"> This is a demonstration. </p>

document.getElementById("demo").innerHTML = "Hello World!";

Software testing is a kind of ________ verification.

dynamic

The Open-Closed Principle says: Software modules should be open for ___________ and closed for __________.

extension, modification

True or False: The external JavaScript file must contain the "script" tag with triangle braces.

false

What is the output of the following Python code? s = 'abcdefg' print(s[-2:-6:-2])

fd

In state machine diagrams, the element which is depicted as a double line filled circle with incoming arrow(s) is a

final state

A use case diagram describes the ________ of a software system.

functional requirements

Which is the correct way to commit a modified file to your local git repository?

git add <file> git commit

Suppose you are working on the master branch of your local repo, and you want to create a new branch named featureX to work on a new feature. Which command would you use?

git branch featureX

In Git, having a branch and tag with the same name is not a good practice because:

git checkout checks out the tag consistently

To change to a branch named experimental which already exists, you would use what command?

git checkout experimental

To clone the (already existing) repo <URL> to your current directory, what command do you type?

git clone <URL>

You aren't currently using git, but you want to start working locally on a project you found on Github. So you decide to make a local copy of the remote repo on Github. Which command do you use?

git clone <URL>

In your local Git repo, what command would you use to see which files are modified but unstated?

git diff

You look at your current commits in your local repo and see this: 872fa7e Try something crazy ale8fb5 Important changes to hello.txt 435b61d Initial commit You want to undo the most recent commit - you realize you shouldn't have done "something crazy." What command do you use?

git revert 872fa7e

Fill in the blank. When the button is clicked, the function named myFun should be executed. <button ________> Click me </button>

onclick = "myFun()"

In extreme programming, the "extreme" form of code review that is often practiced is ________.

pair programming

Regression testing is

re-running previously written tests to ensure that software still works correctly after a change

In jUnit, a method with the @BeforeClass annotation is

run once before the entire test class is run.

Fill in the blank so that the statement is true: A UML _______ diagram shows a time-based view of messages between objects, and looks like a table, with columns labeled as objects and actors, with rows representing time steps. Each object and actor has a dashed ______ running vertically down the diagram.

sequence; lifeline

In a use case diagram, what is a primary actor?

something that acts on the system and initiates interaction to achieve a goal

Running "make" command without arguments builds which target in the makefile?

the first target

In JUNit, using the following annotation has what effect? @Test(timeout=5000) public void testSomething() {...}

the test fails if it doesn't finish running in 5000 ms

If we call make without first changing any source components, make does nothing. How does make know that a file has not been changed?

time stamps for files

In Python, which statement would you use to convert the value of txt to upper case? txt = "Hello World"

txt = txt.upper()

A use case is written from the point of view of the:

user

As a young Jedi, I want to use the force so that I can lift my x-wing from the swamp. This is an example of a:

user story

Consider the following statement: As a dedicated movie fan, I want to access information about all upcoming local movie premieres on my phone so that I don't have to look at all the premiere websites one at a time. This is an example of a:

user story

Where are servlet mappings stored for Google App Engine projects?

web.xml

x = "a string1" In Python, how would you slice this string so that y is assigned the value "a string"?

y=x[:-1]

Insert the correct (Python) syntax to add a placeholder for the age parameter. age = 20 txt = "My name is Elvis, and I am __" print(txt.format(age))

{}


Related study sets

Ch 41 Nursing Management: Obesity practice questions

View Set

Series 63 Missed Final Questions

View Set

Biology Midterm Exam Review 2021

View Set

Module 5.3: Credit Card Statement

View Set

Microbiology (Bio 261) Chapter 10

View Set