IUST Advanced software engineering course by Dr. Saeed Parsa. Credits of slides belong to Dr. Saeed Parsa and IUST reverse engineering research laboratory. All slides are available publicly due to COVID 19 Pandemic.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 2
For an in-depth understanding of use case issues, it is a good idea to refer to
the book provided by the Founder of Use Cases, Jacobson.
https://www.ivarjacobson.com/sites/default/files/field_iji_file/article/use-case_2_0_jan11.pdf
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 4
Use Case View?
Captures system functionality as seen by users Built in early stages of development Developed
by analysts and domain experts System behavior, that is what functionality it must provide, is
documented in a use case model.
Use Case Model illustrates the system’s intended functions (use cases), its
surroundings (actors), and relationships between the use cases and actors (use
case diagrams)
High level architecture
5.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 5
Actor ?
An actor is a person, organization, or external
system that plays a role in one or more
interactions with your system. Actors are
drawn as stick figures.
Orderer - someone who places an order to buy.
• Warehouse Office Clerk is to assist in
performing the daily administrative
and organizational functions of the
warehouse office.
o Warehouse Clerk is responsible for
ensuring that products are registered and
packed correctly for shipping or storage.
6.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 6
Use Case ?
A use case is a list of actions or event steps typically defining
the interactions between a role (known in the Unified Modeling
Language (UML) as an actor) and a system to achieve a goal.
7.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 7
1. Association:
A relationship that represents communication between an actor and a use
case; can be navigable in both ways or in only one way.
2. Uses (includes) and extends are two types of relationships between use cases.
•An extends relationship is used to show:
- Optional behavior
- Behavior that is only run under certain conditions,
- Different flows which may be run based on actor selection
•A uses of includes relationship is used to show:
- functionality shared by multiple use cases.
- can be placed in a separate use case, related to these uses cases by a
uses relationship
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 11
1. The application will record and maintain the product quantity in the
stock in the central database.
2. The storekeeper can remove products from the database.
3. The storekeeper can add products into the database.
4. The storekeeper can change the product quantity in the database.
5. The cashier can bill the item by manually entering the bar code or
with a bar code reader.
6. Only the products recorded in the database can be billed.
7. The billed items can be removed from the bill until it has been closed.
The retail support application requirements.
12.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 12
8. The billed item removal must be approved by a store manager by
entering his authentication data.
9. The billed items will be printed on the cash desk bill as they are
entered. The bill will consist of the store name, billed items,
information on removed billed items, the total amount of money to
be paid, and date and time.
10. The product price can be entered or modified only by a properly
authenticated store manager.
The retail support application requirements.
Consider each use case as a capability to cover one or more requirements
13.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 13
Consider each use case as a capability to cover one or more requirements
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 24
• Each use case is documented with a flow of events, use-case scenario,
which is a description of the events needed to accomplish the required
behavior.
• The scenario is written in the language of the domain and describe what
the system should do and not how the system does it.
• The flow of events should include:
-When and how the use case starts and ends
-What interaction the use case has with the actors
-What data is needed by the use case
-The normal sequence of events for the use case
-The description of any alternate or exceptional flows
25.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 25
X Flow of Events for the Use Case
X.1 Preconditions & Postconditions
X.2 Main Flow
X.3 Subflows (if applicable)
X.4 Alternative Flows
Where X is a number from 1 to the number of use cases
26.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 26
• Main flow of events:
(E1) The use case starts when the system prompts the User for a PIN
number. The User can now enter a
PIN number via the keypad.
(E2) The User commits the entry by pressing the Enter button.
(E3) The system then checks this PIN number to see if it is valid. If the
PIN number is valid, the system acknowledges the entry, thus
ending the use case.
• Subflows:
S1: The system invokes Validate use case.
27.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 27
• Alternative flow of events:
E1: The User can clear a PIN number any time before committing it and
reenter a new PIN number.
E2: The User can cancel a transaction at any time by pressing the Cancel
button, thus restarting the use
case. No changes are made to the User’s account.
E3: If the User enters an invalid PIN number, the use case restarts. If this
happens three times in a row, the
system cancels the entire transaction, preventing the User from
interacting with the ATM for 30
minutes.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 31
Web Customer actor uses some web site to make purchases
online.
Top level use cases are View Items, Make
Purchase and Client Register.
View Items use case could be used by customer as top level use case
if customer only wants to find and see some products. This use case
could also be used as a part of Make Purchase use case.
Client Register use case allows customer to register on the web site,
for example to get some coupons or be invited to private sales.
Note, that
Checkout use case is included use case not available by itself -
checkout is part of making purchase.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 33
• View Items use case is extended by several optional use cases -
customer may search for items, browse catalog, view items
recommended for him/her, add items to shopping cart or wish list.
• All these use cases are extending use cases because they provide some
optional functions allowing customer to find item.
• Customer Authentication use case is included in view
Recommended Items and Add to Wish List because both
require the customer to be authenticated.
• At the same time, item could be added to the shopping cart without
user authentication.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 35
• Checkout use case includes several required uses cases.
• Web customer should be authenticated. It could be done through
user login page, user authentication cookie ("Remember me") or
Single Sign-On (SSO).
• Web site authentication service is used in all these use cases, while
SSO also requires participation of external identity provider.
• Checkout use case also includes Payment use case which could be
done either by using credit card and external credit payment service
or with PayPal.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 37
Main functional flow of an online shopping system
38.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 38
An example of high level sequence
diagram for online bookshop. Online
customer can search book catalog,
view description of a selected book,
add book to shopping cart, do
checkout
39.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 39
Each customer has unique id, linked to one account.
Account owns shopping cart and orders.
Customer could register as a web user to buy items online.
Customer could purchases by phone or by ordering from catalogues.
Web user has login name which also serves as unique id.
Web user could be in several states - new, active, temporary blocked,
or banned, and be linked to a shopping cart.
Shopping cart belongs to account.
40.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 40
Account owns customer orders. Customer may have no orders.
Each order could refer to several payments, possibly none.
Every payment has unique id and is related to exactly one account.
Both order and shopping cart have line items linked to a specific
product.
Each line item is related to exactly one product. A product could be
associated to many line items or no item at all.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 42
• As shown in the next slide, the webStore subsystem contains three components:
Search Engine, Shopping Cart, and Authentication.
• Search Engine component allows to search or browse items by exposing provided
interface Product Search and uses required interface
• Search Inventory provided by Inventory component.
• Shopping Cart component uses Manage Orders interface provided by Orders
component during checkout.
• Warehouses subsystem provides two interfaces Search Inventory and Manage
Inventory used by other subsystems and wired through dependencies.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 44
UML Deployment Diagram Example
45.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 45
• Package diagrams depict the organization of model elements into Packages
and the dependencies amongst them, including Package imports and
Package extensions. They also provide a visualization of the corresponding
namespaces.
46.
4/21/2020 S. Parsa(www.parsa.iust.ac.ir) 46
The Nesting connector between ConnSeq and
Controller reflects what the Package contents
reveal. The Package contents can be listed by
clicking on the diagram background to
display the diagram's 'Properties' dialog,
selecting the 'Elements' tab and selecting the
'Package Contents' checkbox in the 'Show
Compartments' panel
The «import» connector indicates that the elements within the
target Integer Package, which in this example is the single Class
Integer, have been imported into the Package Controller
If an element already exists within GenApply, such as Loader
and Time, these elements' definitions are expanded by those
included in the Package Controller. All elements added or
updated by the merge are noted by a generalization
relationship back to that Package.
بدافزار رفتاری تحليلهایمکانيزم
نیروه به هشدارای
مسلح
By Kaspersky Lab on October 30, 2013. 2:44 am
1-زمانیکهجاواطراحی،شددرعملحمالتازطريق
سویاستفادهازآسيبپذيریهاوجودنداشت.
2-استفادهبيشازحدازجاواموجبتوجهبيشاز
حدمهاجمينوهکرهابهاينزبانشدهاست.بنابر
اظهاراتاوراکلزبانجاوامورداستفادهدربيش
ازسهبيليونابزاردرسراسرجهانبودهاست.
3-استفادهزيادازجاوادليلآشکارشدنآسيب
نتايحبررسیهایانجامشده
درمرکزتحقيقاتکسپراسکیبرایمدت12ماهاز
سال2012تا2013درپاسخبهسوال:چراآسيب
پذيریهایجاوابهاينتعدادزيادهستند؟
76.
بدافزار رفتاری تحليلهایمکانيزم
The U.S. Department of Homeland Security warned that a
security update of Oracle Corp's Java software for Web
browsers does not do enough to protect computers from attack,
sticking to its previous advice that the program be disabled.
Technology | Mon Jan 14, 2013 4:16pm ESTRelated: TECH
U.S. says Java still risky, even after security update
BY JIM FINKLE
Java was responsible for 50 percent of all cyber attacks last
year in which hackers broke into computers by exploiting
software bugs, according to Kaspersky Lab (2012).
مرکزامنيتیهوملندآمريکاهشداردادکه
بهروزرسانیوتصحيحجاواتوسطشرکت
اوراکلبرایمرورگرهایوبنتيجهبخشنبوده
ونمیتواندمانعحمالتبهسيستمهای
کامپيوتریشود.
متخصصهایامنيتهشداردادهاندکه
کامپيوترهایشخصیکهدرمرورگرخودجاوا
رابهاجرادرمیآورندممکناستمورد
تهاجممجرمينقرارگيرند.
بنابربيانيهکسپراسکی50%کليهحمالت
سايبریدرسال،گذشتهباورودهکرهااز
طريقآسيبپذيریهایجاواانجامشد
مسلح نیروهای به هشدار
77.
بدافزار رفتاری تحليلهایمکانيزم
The Web Just Became More Secure:
Google Drops Support for Java
Written by Matthew HughesSeptember 11, 2015
Ads by Google
It’s safe to say that Java – particularly in the browser – has lost
its shine. A large part of this is due to security concerns. The
next version of Google Chrome (version 45, scheduled for
December) has removed support for it entirely.
مسلح نیروهای به هشدار
#37 n example of activity diagram for online shopping. Online customer can browse or search items, view specific item, add it to shopping cart, view and update shopping cart, checkout. User can view shopping cart at any time. Checkout is assumed to include user registration and login.
This example does not use partitions, most of the actions are assumed to be fulfilled by online customer.
#38 n example of activity diagram for online shopping. Online customer can browse or search items, view specific item, add it to shopping cart, view and update shopping cart, checkout. User can view shopping cart at any time. Checkout is assumed to include user registration and login.
This example does not use partitions, most of the actions are assumed to be fulfilled by online customer.
#45 An example of web application UML deployment diagram. Book club web application artifact book_club_app.war is deployed on Catalina Servlet 2.4 / JSP 2.0 Container which is part of Apache Tomcat 5.5 web server.
The book_club_app.war artifact manifests (embodies) OnlineOrders component. The artifact contains three other artifacts, one of which manifests UserServices component.
The Application Server «device» (computer server) has communication path to Database Server «device» (another server).
#50 امنیت نرم افزار به مفهوم مهندسی کردن نرم افزار به صورتی است که نرم افزارهای مورد نیاز ه صورت بی وقفه عمل نموده قادر یه کنترل تهدیدات امنیتی در هنگام حملات بدخواهای باشد.
روش صحیح مهندسی نرم افزار این است که در مورد امنیت هم از آغاز چرخه حیات، اقدام شود. بر طبق تعریف اطمینان از نرم افزار یا سافتویر اشورنس میزان اطمینان از عدم آسیب پذیری نرم افزار می باشد.
در شکل فوق جرخه حیات تولید نرم افزار امن مشخص شده است. این چرخه حیات ذاتاً تکراری است. اگر کمبودی بعداً برای مرحله ای مشاهده شود، باید به آن مرحله برگشت و کمبد را جبران گرد. برای نمونه اگر یک سیستم پنهان نگاری را ایجاد می کنید و بعداً مشاهده کنید که نیازهایی نادیده گرفته شده باید به مرحله تعیین نیاز بازگشت نمود و آن نیازها را بروزرسانی کرد.
#52 Before defining security requirements, security engineers need to identify those parts of the software system that requires security. These parts of the software system are
called Target of Evaluation (TOE). Once TOE is identified then finding security functional requirements (SFR) for those parts becomes simple. [8] lists different set of classes depending on the nature of application. Different set of SFRs can be chosen for the required TOE. Once required SFRs are chosen, then table can be designed to monitor its implementation in required software application. SFRs are chosen to counter threats in TOE of software system. For example; if we are trying to gather SFR of a web application; Table 1 lists related SFR’s and their activity. There can be different TOE in a single software application; therefore different set of SFRs are collected for each TOE.
Once the uncertain requirements are refined by SFR module, then we are ready to start designing our software. Design phase is important and requires more consideration in terms of security. Based on the information provided by analysis phase (Security Requirements by user stories and SFR) a threat model is developed. If security engineer feels some of the information is missing or some other security threats are possible then it goes back to analysis for the refinement of the security requirements. If security expert finds no problems, then a mitigation plan is designed to cater all those threats listed in threat model. Requirements engineering is the main building block for any software development. Security engineers try to elicit security requirements by different methods, e.g. user stories, abuse cases, etc.
Most of the occasion requirements gathered from user stories and other sources are not well defined. These requirements can be refined by security functional requirements (SFR) module (Details are given in section ‘IV-A’).
#60 تعیین زیرسیستم ها و مجوزهای دسترسی به هر زیر سیستم – برای نمونه دسترسی به زیر سیستم مالی – تعیین نرم افزارها بر اساس میزان اضطرار
#61 Privileged Code
When you design and build secure assemblies, be able to identify privileged code. This has important implications for code access security. Privileged code is managed code that accesses secured resources or performs other security sensitive operations such as calling unmanaged code, using serialization, or using reflection. It is referred to as privileged code because it must be granted permission by code access security policy to be able to function. Non-privileged code only requires the permission to execute.
Auditing is the practice of inspecting logs for the purpose of verifying that the system is in a desirable state
In software engineering, software configuration management (SCM) is the task of tracking and controlling changes in the software
#63 باید با توجه به شش دسته تهدیدات مدل تهدید را مشخص نمود.