Command line application for checking site connection in a background mode by sending ICMP messages.
Usually, when people need some site to interact with and it crashes, they update the page many times to check whether the site is available or not. Instead of this, we propose the command line app which will ping the site every minute by sending ICMP messages in a background mode. When the site becomes available the app will send notification with site link to the user.
- Windows OS
- Python3
- Python libraries from requirements.txt
- From Site-connectivity-checker repository download all the documents to your local project
- From the project directory write in command line/terminal
pip install -r requirements.txt
to install all the required libraries - From the project directory write in command line/terminal
python3 ./main.py
orpython main.py
to run the app
Name | Description |
---|---|
Ping | an ICMP message to the site server |
Pinger/Checker | a program that sends ICMP messages to the site server |
Notification | a short window that activates when the site is available |
Sitelist/Data | a local database to store all the site links |
Checklist | a pinging at the moment site links storage |
Request processing system | a system that gets request from the user and depending on that sends this request to the data storage or to the pinger |
- After starting app execution you should add sites, which you often visit, to the sitelist.
- When some of these sites crashes - start pinging it, also this site will be added to the checklist automatically.
- As soon as the site is available again, the app will stop pinging it, send you notification with a link and delete this site from the checklist.
- If the app is pinging the site, but you are not interested in that site anymore, just stop pinging.
- You can also see the sitelist, the checklist, add new sites and delete old ones whenever you want.
- Stop app execution if there is no need in that.
add <site link>
to add the site to sitelistdelete <site link>
to delete the site from siteliston <site link>
to start pinging the site untill it will be availableoff <site link>
to stop pinging the site if you are not interested anymore in this sitechecklist
to see the list of sites that pinger is pinging nowsitelist
to see the list of all sites addedquit
to stop the app
We decided to use observer pattern as it perfectly suits to our solution: an object (pinger) maintains dependent (user), called observer, and automatically notifies it about any changes (sites' availability) using special methods (sending notifications).
- Single Responsibility Principle - the source code consists of 2 classes: one of them is a pinger, which is responsible for pinging sites. Another class is responsible for the client side, where actions with the database take place and notifications are called. In our case, we have implemented a client under WindowClient.py.
- Open-closed Principle - the pinger contains a list of users, which are classes inherited from Client. Thus, you can create a class that inherits Client for another OS without changing the Pinger class.
- Liskov substitution Principle - functions working with base classes have the ability to use objects of derived classes.
- Interface Segregation Principle - interfaces contain only necessary for pinging and managing data methods.
- Dependency Inversion Principle - the relationship between classes is based on dependencies on abstractions, not on concrete implemented classes.
Here are static and dynamic view diagrams of Site connectivity checker project.
Code review was done by Codacy linter. All the code-related issues are minor, we decided to not follow exactly these Codacy recommendations because it will affect our design and architecture decisions.
Test coverage is 89%:
- Functional requirements
- Business goals
- Non-functional requiremants
- Roles and responsobilities
- User stories
- Software development plan
are available here.
Evgeniy Lutanin, Karina Singatullina,
Innopolis University, AAI