The journey

6 minutes

Wstęp

It’s time to start my journey. I have been hesitating for a long time whether to enter “Get Notice” competition because I knew how much time I would have to spend on writing the application and dealing with the blog. I am an ambitious person. I want to kill two birds with one stone namely, write the blog in two languages. My Polish and English version won’t be the exactly the same translations but they would rather be like twins being very similar text. Another challenge can be the technology which I have chosen. I haven’t used Asp.Net Core before, which means the application won’t be a product but rather the proof of technology. This application won’t optimise either the class or the method; it aims at analysing some problems or showing one of the possible solutions to them. This means I have to time more time on researching different technologies.ologii.

Projekt

Project Optimal Word Learning (OWL) helps people who want to understand books, articles, and instruction, manuals fast.

Readers usually check words when reading different things. Many people tend to look up the same words in dictionaries many times. Even if they have checked these words they quickly forget what they mean. This kind of gaining new knowledge is time-consuming and ineffective. Thanks to my program they will facilitate their learning process.

The application has been designed to create some word lists. By knowing 70% of words coming from the text you want to read, you will be able to understand over 90% of it. The user of this application gets the word list (70%) to memorize. This approach lets readers minimize the time required to fully (90%) understand each text.

Another advantage is that subsequent readings will be understood faster. The application creates playlists consisting of unknown to the reader words. You may download them as mp3 files and listen to them anytime you want. Once you have learned particular words, you may add them to your personal word list consisting of familiar words. Every next reading passage will not contain the words from your personal word list.

Those who fluently speak English and are eager to expand their knowledge about, for example, programming, will be able to extract some concepts (like encapsulation, inheritance, polymorphism). As soon as the concepts are understood by the reader, the text will be comprehended in 100%.

The application will be written in ASP.Net Core in C#. The database will be any because of the use of the repository pattern, but I will write about this in my further post.
The solution will consist of four projects:

  • Owl.Library,
  • Owl.Library.UnitTests,
  • Owl.Mvc,
  • Owl.Mvc.UnitTests.

I have chosen XUnit for unit tests. What can we choose from? The most popular framework: NUnit, MStest, XUnit. Full compare you may see here.
So, I begin with writing the application. I open Visual Studio 2017 and create the solution, next I add four projects. 

Solution Explorer VS2017

After that, I added some references to appropriate projects. (TooExe.Owl.Library.UnitTests => TooExe.Owl.Library) and (TooExe.Owl.Mvc => TooExe.Owl.Mvc.UnitTests)

AddReference VS2 2017

Reference Manager VS 2017

 

Below we can see that the references were added.

Solution Explorer VS 2017 Dependencies

Once our solution has been prepared we may start to write the first functionality. The application will be written using the TDD (Test-Driven Development) programming technique. Many articles and books wrote about TDD. I will try to minimize the theory and show how the example.

What is TDD? TDD is a programming technique that means the technique used to write and build code.

Goals:

  1. Writing the test before writing the implementation of code forces us to rethink the design in our project. Test class should be isolated from other classes. The programmer must identify the places where dependencies (Shims) occur and to design a class of their consideration. TDD enforces good design by identifying the interaction and interface between classes. In this approach, we get loosely coupled classes.

  2. The unit test must document our application. Thanks to that we test and implement the code, which fulfills the client’s requirements. When considering testing in terms of the requirements we need to define boundary points for each criterion, for example, repeatability of words, the file without data or exceptions in nouns (plural and single forms).

  3. In TDD we don’t write tests and we don’t implement code to things we do not need now.

 

The key aspect of TDD is writing a series of tests. First, we write the tests, then we implement the functionality and finally start the refactoring process.

    1. Red: We write a test that fails. Tests are written to empty, but existing classes and methods (so we can use IntelliSense).
      We run the test and we expect it to fail.
    2. Green: We write a code to make the test pass. We implement the code (according to the documentation). We run the tests. All the tests must be successful.
    3. Refactor: We make some changes that improve the quality of the code (eg. Removing duplicate lines of code) but do not change its functionality. After refactoring, we rerun all tests make sure we did not destroy anything.

TDD

I will not discuss the advantages and disadvantages of such an approach. In my opinion, it is worth considering.