Clone this repository and bring the code pieces you need into your BDSA Assignments GitHub repository.
Consider the two methods you implemented last week:
IEnumerable<T> Flatten<T>(IEnumerable<IEnumerable<T>> items)
IEnumerable<T> Filter<T>(IEnumerable<T> items, Predicate<T> predicate)
Given the following collections in scope:
IEnumerable<int>[] xs;
int[] ys;
Solve the following questions with extension methods (one-liners):
- Flatten the numbers in
xs
. - Select numbers in
ys
which are divisible by7
and greater than42
. - Select numbers in
ys
which are leap years.
Write the answers in the .pdf file with all non-code solutions.
Implement and test the following extension methods:
- A method
IsSecure
which extendsUri
and returns true if theUri
is using Secure Hypertext Transfer Protocol. - A method
WordCount
which extendsstring
and returns the number of words in the string. Note a word can only contain unicode letters (no numbers or symbols).
Use the supplied Extensions.cs
and ExtensionsTests.cs
files.
Implement the following anonymous functions using the built-in delegates and lambda expressions:
- A method which takes a string and prints the content in reverse order (by character)
- A method which takes two decimals and returns the product
- A method which takes a whole number and a string and returns
true
if they are numerically equal. Note that the string" 0042"
should return true if the number is42
Write the answers in the .pdf file with all non-code solutions.
You probably want to implement a set of tests to validate the methods.
Use the supplied DelegatesTests.cs
file.
Prerequisite: Extend the Wizards.csv
file with at least 10 wizard of your choosing to enable the queries above.
Examine the Wizard
class and its corresponding unit test class.
Then, given the Wizard
class:
public class Wizard
{
public string Name { get; set; }
// Book or film or...
public string Medium { get; set; }
public int? Year { get; set; }
public string Creator { get; set; }
public static Lazy<IReadOnlyCollection<Wizard>> Wizards { get; } = new Lazy<IReadOnlyCollection<Wizard>>(() =>
{
var csv = File.OpenText("../../../../Wizards.csv");
using (var reader = new CsvReader(csv))
{
reader.Configuration.Delimiter = ",";
return reader.GetRecords<Wizard>().ToList().AsReadOnly();
}
});
}
Use the supplied Queries.cs
and corresponding tests class to implement and test the following queries using LINQ:
(You need to wrap the queries in suitable methods for testing)
- Wizards invented by Rowling. Only return the names.
- The year the first sith lord was introduced. Let's define a sith lord to be one named Darth something.
- Unique list of wizards from the Harry Potter books - only return name and year (as a value tuple).
- List of wizard names grouped by creator in reverse order by creator name and then wizard name.
Each method must be implemented twice - once using only extension methods and once using as much LINQ as possible.
Research what a Kanban board is. Possibly starting from here, acquire sufficient application domain knowledge to write two as-is scenarios that represent the main usage of a physical Kanban board within a software engineering team. Note: make sure to cite your references in the submission document.
As a design activity (i.e., before writing the code): draw a class diagram of the objects representing your analysis of the application domain related to Exercise 1. The purpose of the diagram should be to sketch
the main relationships between the entities and their multiplicity. To challenge yourselves, consider that often teams use the boards to also highlight task allocation (i.e., who is responsible for/will complete/has taken a card) and that nowadays pair programming or other group practices are used to implement code. How would you model this feature?
- The acronym FURPS+ stands for: F_____________; U_____________; R_____________; P_____________; S_____________; +_____________.
- The requirements engineering process is an iterative process that includes requirements ______________, ______________, and ______________.
- Software engineering is a collection of ______________, ______________, and ______________ that help with the production of a ______________ software system developed ______________ before a ______________ while change occurs.
- Requirements need to be complete, ______________, ______________, and ______________.
- Important properties of requirements are realism, ______________, and ______________.
- The output of the ______________ activity is the ______________, which include both the non-functional requirements and the functional model.
- What level of details should UML models have?
- What is the difference between structure diagrams and behavior diagrams in UML? Provide two examples per category.
Consider a file system with a graphical user interface, such as Macintosh’s Finder, Microsoft’s Windows Explorer, or Linux’s KDE. The following objects were identified from a use case describing how to copy a file from a floppy disk to a hard disk: File, Icon, TrashCan, Folder, Disk, Pointer. Specify which are entity objects, which are boundary objects, and which are control (interactor) objects.
Assuming the same file system as before, consider a scenario consisting of selecting a file on a floppy, dragging it to Folder and releasing the mouse. Identify and define one control (interactor) object associated with this scenario.
Arrange the objects listed in Exercises SE.5-6 horizontally on a sequence diagram, the boundary objects to the left, then the control (interactor) object you identified, and finally, the entity objects. Draw the sequence of interactions resulting from dropping the file into a folder. For now, ignore the exceptional cases.
From the sequence diagram Figure 2-34, draw the corresponding class diagram. Hint: Start with the participating objects in the sequence diagram.
To submit the assignment you need to create a .pdf document using LaTeX containing the answers to the questions and a link to a public repository containing your fork of the completed code.
Members of the triplets should submit the same PDF file to pass the assignments. Make sure all group names and ID are clearly marked on the front page.