Showing posts with label Database. Show all posts
Showing posts with label Database. Show all posts

How to Test Web Applications against SQL Injection Attacks

Many applications use some type of a database. An application under test might have a user interface that accepts user input that is used to perform the following tasks:

1.    Show the relevant stored data to the user e.g. the application checks the credentials of the user using the log in information entered by the user and exposes only the relevant functionality and data to the user

2.    Save the data entered by the user to the database e.g. once the user fills up a form and submits it, the application proceeds to save the data to the database; this data is then made available to the user in the same session as well as in subsequent sessions

SQL injection

Some of the user inputs might be used in framing SQL statements that are then executed by the application on the database. It is possible for an application NOT to handle the inputs given by the user properly. If this is the case, a malicious user could provide unexpected inputs to the application that are then used to frame and execute SQL statements on the database. This is called SQL injection. The consequences of such an action could be alarming.

The following things might result from SQL injection:

1. The user could log in to the application as another user, even as an administrator.
2. The user could view private information belonging to other users e.g. details of other users’ profiles, their transaction details etc.
3. The user could change application configuration information and the data of the other users.
4. The user could modify the structure of the database; even delete tables in the application database.
5. The user could take control of the database server and execute commands on it at will.

Since the consequences of allowing the SQL injection technique could be severe, it follows that SQL injection should be tested during the security testing of an application. Now with an overview of the SQL injection technique, let us understand a few practical examples of SQL injection.

Important: The SQL injection problem should be tested only in the test environment. 

If the application has a log in page, it is possible that the application uses a dynamic SQL such as statement below. This statement is expected to return at least a single row with the user details from the Users table as the result set when there is a row with the user name and password entered in the SQL statement.

SELECT * FROM Users WHERE User_Name = ‘” & strUserName & “‘ AND Password = ‘” & strPassword & “’;”

If the tester would enter John as the strUserName (in the textbox for user name) and Smith as strPassword (in the textbox for password), the above SQL statement would become:

SELECT * FROM Users WHERE User_Name = ‘John’ AND Password = ‘Smith’;

If the tester would enter John’– as strUserName and no strPassword, the SQL statement would become:

SELECT * FROM Users WHERE User_Name = ‘John’– AND Password = ‘Smith’;

Note that the part of the SQL statement after John is turned into a comment. If there were any user with the user name of John in the Users table, the application could allow the tester to log in as the user John. The tester could now view the private information of the user John.
What if the tester does not know the name of any existing user of the application? In such a case, the tester could try common user names like admin, administrator and sysadmin. If none of these users exist in the database, the tester could enter John’ or ‘x’=’x as strUserName and Smith’ or ‘x’=’x  as strPassword. This would cause the SQL statement to become like the one below.

SELECT * FROM Users WHERE User_Name = ‘John’ or ‘x’='x’ AND Password = ‘Smith’ or ‘x’=’x’;

Since ‘x’=’x’ condition is always true, the result set would consist of all the rows in the Users table. The application could allow the tester to log in as the first user in the Users table.

Important: The tester should request the database administrator or the developer to copy the table in question before attempting the following SQL injection.

If the tester would enter John’; DROP table users_details;’—as strUserName and anything as strPassword, the SQL statement would become like the one below.

SELECT * FROM Users WHERE User_Name = ‘John’; DROP table users_details;’ –‘ AND Password = ‘Smith’;

This statement could cause the table “users_details” to be permanently deleted from the database.
Though the above examples deal with using the SQL injection technique only the log in page, the tester should test this technique on all the pages of the application that accept user input in textual format e.g. search pages, feedback pages etc.

SQL injection might be possible in applications that use SSL. Even a firewall might not be able to protect the application against the SQL injection technique.

I have tried to explain the SQL injection technique in a simple form. I would like to re-iterate that SQL injection should be tested only in a test environment and not in the development environment, production environment or any other environment. Instead of manually testing whether the application is vulnerable to SQL injection or not, one could use a web vulnerability scanner that checks for SQL injection.

source : softwaretestinghelp

OLAP (Online Analytical Processing)

OLAP (online analytical processing) is computer processing that enables a user to easily and selectively extract and view data from different points of view. For example, a user can request that data be analyzed to display a spreadsheet showing all of a company's beach ball products sold in Florida in the month of July, compare revenue figures with those for the same products in September, and then see a comparison of other product sales in Florida in the same time period. To facilitate this kind of analysis, OLAP data is stored in a multidimensional database. Whereas a relational database can be thought of as two-dimensional, a multidimensional database considers each data attribute (such as product, geographic sales region, and time period) as a separate "dimension." OLAP software can locate the intersection of dimensions (all products sold in the Eastern region above a certain price during a certain time period) and display them. Attributes such as time periods can be broken down into subattributes.

Why OLAP?


Knowledge is the foundation of all successful decisions.

Successful businesses continuously plan, analyze and report on sales and operational activities in order to maximize efficiency, reduce expenditures and gain greater market share.

All businesses collect data using many different systems, and the challenge remains: how to get all the data together to create accurate, reliable, fast information about the business. A company that can take advantage of reliable information and turn it into shared knowledge, accurately and quickly, will surely be better positioned to make successful business decisions and rise above the competition.

OLAP applications are developped to provide fast and interactive ad-hoc exploration, comparison and analysis of data, regardless of database size and complexity. It allows end users to manipulate and derive data for analysis purposes by applying analytical operations such as ratios, cumulative totals, trends and allocations across dimensions and across hierarchical levels.
OLAP can be used for data mining or the discovery of previously undiscerned relationships between data items. An OLAP database does not need to be as large as a data warehouse, since not all transactional data is needed for trend analysis. Using Open Database Connectivity (ODBC), data can be imported from existing relational databases to create a multidimensional database for OLAP.

Two leading OLAP products are Hyperion Solution's Essbase and Oracle's Express Server. OLAP products are typically designed for multiple-user environments, with the cost of the software based on the number of users.

In the OLAP world, there are mainly two different types: Multidimensional OLAP (MOLAP) and Relational OLAP (ROLAP). Hybrid OLAP (HOLAP) refers to technologies that combine MOLAP and ROLAP.

MOLAP
Excellent performance- this is the more traditional way of OLAP analysis. In MOLAP, data is stored in a multidimensional cube. The storage is not in the relational database, but in proprietary formats. MOLAP is the most standard approach to OLAP solutions. It uses a multidimensional database which directly stores the information contained in the various cubes. This is the best performing solution when using SQL Server Analysis services.

Advantages:

MOLAP cubes are built for fast data retrieval, and are optimal for slicing and dicing operations.

They can also perform complex calculations. All calculations have been pre-generated when the cube is created. Hence, complex calculations are not only doable, but they return quickly.

Disadvantages:
It is limited in the amount of data it can handle. Because all calculations are performed when the cube is built, it is not possible to include a large amount of data in the cube itself. This is not to say that the data in the cube cannot be derived from a large amount of data. Indeed, this is possible. But in this case, only summary-level information will be included in the cube itself.

It requires an additional investment. Cube technology are often proprietary and do not already exist in the organization. Therefore, to adopt MOLAP technology, chances are additional investments in human and capital resources are needed.

ROLAP

This methodology relies on manipulating the data stored in the relational database to give the appearance of traditional OLAP's slicing and dicing functionality. In essence, each action of slicing and dicing is equivalent to adding a "WHERE" clause in the SQL statement. Relational Online Analytical Processing (ROLAP) provides the same solution but uses a relational database for storage of the data. This approach translates native OLAP queries, written in a language called multidimensional expressions (MDX) into the appropriate SQL statements. This is primarily done to prevent the need for another copy of the data. The data created directly by the online transaction processing (OLTP) applications are used. The primary disadvantage to this solution is that it does not, generally speaking, perform as well as a MOLAP database.

Advantages:
It can handle large amounts of data. The data size limitation of ROLAP technology is the limitation on data size of the underlying relational database. In other words, ROLAP itself places no limitation on data amount.

It can leverage functionalities inherent in the relational database. Often, relational database already comes with a host of functionalities. ROLAP technologies, since they sit on top of the relational database, can therefore leverage these functionalities.

Disadvantages:

Performance can be slow. Because each ROLAP report is essentially a SQL query (or multiple SQL queries) in the relational database, the query time can be long if the underlying data size is large.

It has limited by SQL functionalities. Because ROLAP technology mainly relies on generating SQL statements to query the relational database, and SQL statements do not fit all needs (for example, it is difficult to perform complex calculations using SQL), ROLAP technologies are therefore traditionally limited by what SQL can do. ROLAP vendors have mitigated this risk by building into the tool out-of-the-box complex functions as well as the ability to allow users to define their own functions.

HOLAP
HOLAP technologies attempt to combine the advantages of MOLAP and ROLAP. For summary-type information, HOLAP leverages cube technology for faster performance. When detail information is needed, HOLAP can "drill through" from the cube into the underlying relational data. HOLAP) is a hybrid approach to the solution where the aggregated totals are stored in a multidimensional database while the detail data is stored in the relational database. This is the balance between the data efficiency of the ROLAP model and the performance of the MOLAP model.

If you're developing applications, you ultimately do not care which model is being used because your code will work against any kind of OLAP model (unless you're creating the cubes yourself). It is only a concern when a large scale project is being rolled out and you must decide which solution will meet its unique needs.

source: OLAP sites


Data interchange

Data exchange is the process of taking data structured under a source schema and actually transforming it into data structured under a target schema, so that the target data is an accurate representation of the source data.

The following is an incomplete list of popular generic languages used for data exchange in multiple domains.

Schemas Flexible Semantic verification Dictionary -Taxonomy Synonyms and homonyms Dialecting Web standard Transformations Lightweight Human readable Compatibility
XML Yes[1] Yes No No No Yes Yes Yes No No subset of SGML, HTML
Atom Yes Unknown Unknown Unknown Unknown Yes Yes Yes No No XML dialect
JSON No Unknown Unknown Unknown Unknown No Yes No Yes No subset of JavaScript
YAML No[2] Unknown Unknown Unknown Unknown No No No[2] Yes Yes[3] superset of JSON
REBOL Yes[6] Yes No Yes Yes Yes No Yes[6] Yes Yes[4]
Gellish Yes Yes Yes Yes[7] Yes Yes ISO No Yes Partial[5] SQL, RDF/XML, OWL
Nomenclature:
  •     Schemas - Whether the language definition is available in a computer interpretable form.
  •     Flexible - Whether the language enables extension of the semantic expression capabilities without modifying the schema.
  •     Semantic verification - Whether the language definition enables semantic verification of the correctness of expressions in the language.
  •     Dictionary-Taxonomy - Whether the language includes a dictionary and a taxonomy (subtype-supertype hierarchy) of concepts with inheritance.
  •     Synonyms and homonyms - Whether the language includes and supports the use of synonyms and homonyms in the expressions.
  •     Dialecting - Whether the language definition is available in multiple natural languages or dialects.
  •     Web or ISO standard - Organization that endorsed the language as a standard.
  •     Transformations - Whether the language includes a translation to other standards.
  •     Lightweight - Whether a lightweight version is available, in addition to a full version.
  •     Human readable - Whether expressions in the language are readable by humans without training.
  •     Compatibility - Which other tools are possible or required when using the language.
XML for data exchange. The popularity of XML for data exchange on the World Wide Web has several reasons. First of all, it is closely related to the preexisting standards Standard Generalized Markup Language (SGML) and Hypertext Markup Language (HTML), and as such a parser written to support these two languages can be easily extended to support XML as well. For example, XHTML has been defined as a format that is formal XML, but understood correctly by most (if not all) HTML parsers. This led to quick adoption of XML support in web browsers and the toolchains used for generating web pages.

JSON for data exchange. Actually a part of the JavaScript programming language, the JSON (JavaScript Object Notation) was split out into a low-level format for structured data exchange. While it was originally not designed for data exchange at all, it was discovered to be useful. In contrast to XML above, there exist no schema definition and no support for dialecting. The key benefits of this language are the low overhead (the amount of data needed for structuring) compared to XML and the similarly wide support: every web browser that has JavaScript support can also process JSON.

YAML for data exchange. YAML is a language that was designed to be human-readable (and as such to be easy to edit with any standard text editor). Its notion often is similar to reStructuredText or a Wiki syntax, who also try to be readable both by humans and computers. YAML 1.2 also includes a shorthand notion that is compatible with JSON, and as such any JSON document is also valid YAML; this however does not hold the other way.

REBOL for data exchange. REBOL is a language that was designed to be human-readable and easy to edit using any standard text editor. To achieve that it uses a simple free-form syntax with minimal punctuation, and a rich set of datatypes. REBOL datatypes like URLs, e-mails, date and time values, tuples, strings, tags, etc. respect the common standards. REBOL is designed to not need any additional meta-language, being designed in a metacircular fashion. The metacircularity of the language is the reason why e.g. the Parse dialect used (not exclusively) for definitions and transformations of REBOL dialects is also itself a dialect of REBOL. REBOL was used as a source of inspiration by the designer of JSON.

Gellish for data exchange. Gellish English is a formalized subset of natural English, which includes a simple grammar and a large extensible English Dictionary-Taxonomy that defines the general and domain specific terminology (terms for concepts), whereas the concepts are arranged in a subtype-supertype hierarchy (a Taxonomy), which supports inheritance of knowledge and requirements. The Dictionary-Taxonomy also includes standardized fact types (also called relation types). The terms and relation types together can be used to create and interpret expressions of facts, knowledge, requirements and other information. Gellish can be used in combination with SQL, RDF/XML, OWL and various other meta-languages. The Gellish standard is being adopted as ISO 15926-11.

JSON, or JavaScript Object Notation, is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects. The official Internet media type for JSON is application/json. The JSON filename extension is .json. The JSON format is often used for serializing and transmitting structured data over a network connection. It is used primarily to transmit data between a server and web application, serving as an alternative to XML.

XML. XML has been used to describe structured data and to serialize objects. Various XML-based protocols exist to represent the same kind of data structures as JSON for the same kind of data interchange purposes. When data is encoded in XML, the result is typically larger than an equivalent encoding in JSON, mainly because of XML's closing tags. Yet, if the data is compressed using an algorithm like gzip there is little difference because compression is good at saving space when a pattern is repeated.

In XML there are alternative ways to encode the same information because some values can be represented both as child nodes and attributes. This can make automated data exchange complicated unless the used XML format is strictly specified as programs need to deal with many different variations of the data structure. Both of the following XML examples carry the same information as the JSON example above in different ways.

YAML is a human-readable data serialization format that takes concepts from programming languages such as C, Perl, and Python, and ideas from XML and the data format of electronic mail (RFC 2822). YAML is a recursive acronym for "YAML Ain't Markup Language". Early in its development, YAML was said to mean "Yet Another Markup Language", but was retronymed to distinguish its purpose as data-oriented, rather than document markup. YAML syntax was designed to be easily mapped to data types common to most high-level languages: list, associative array, and scalar.
 
source: wikipedia

About Oracle Database

The Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is an object-relational database management system (ORDBMS) produced and marketed by Oracle Corporation.

Database Schema

Oracle database conventions refer to defined groups of object ownership (generally associated with a "username") as schemas.

Most Oracle database installations traditionally came with a default schema called SCOTT. After the installation process has set up the sample tables, the user can log into the database with the username scott and the password tiger. The name of the SCOTT schema originated with Bruce Scott, one of the first employees at Oracle (then Software Development Laboratories), who had a cat named Tiger.

Oracle Corporation has de-emphasized the use of the SCOTT schema, as it uses few of the features of the more recent releases of Oracle. Most recent examples supplied by Oracle Corporation reference the default HR or OE schemas.

Other default schemas include:
  •     SYS (essential core database structures and utilities)
  •     SYSTEM (additional core database structures and utilities, and privileged account)
  •     OUTLN (utilized to store metadata for stored outlines for stable query-optimizer execution plans.[11]
  •     BI, IX, HR, OE, PM, and SH (expanded sample schemas[12] containing more data and structures than the older SCOTT schema).

Version numbering

Oracle products follow a custom release numbering and naming convention. With the Oracle RDBMS 10g release, Oracle Corporation began using the "10g" label in all versions of its major products, although some sources refer to Oracle Applications Release 11i as Oracle 11i.The suffixes "i" and "g" do not actually represent a low-order part of the version number, as letters typically represent in software industry version numbering; that is, there is no predecessor version of Oracle 10g called Oracle 10f. Instead, the letters stand for "internet" and "grid", respectively. Consequently many simply drop the "g" or "i" suffix when referring to specific versions of an Oracle product.

Major database-related products and some of their versions include:
  •     Oracle Application Server 10g (also known as "Oracle AS 10g"): a middleware product;
  •     Oracle Applications Release 11i (aka Oracle e-Business Suite, Oracle Financials or Oracle 11i): a suite of business applications;
  •     Oracle Developer Suite 10g (9.0.4);
  •     Oracle JDeveloper 10g: a Java integrated development environment;
Since version 5, Oracle's RDBMS release numbering has used the following codes:
  •     Oracle v5
  •     Oracle v6
  •     Oracle7: 7.0.16–7.3.4
  •     Oracle8 Database: 8.0.3–8.0.6
  •     Oracle8i Database Release 1: 8.1.5.0–8.1.5.1
  •     Oracle8i Database Release 2: 8.1.6.0–8.1.6.3
  •     Oracle8i Database Release 3: 8.1.7.0–8.1.7.4
  •     Oracle9i Database Release 1: 9.0.1.0–9.0.1.5 (patchset as of December 2003)
  •     Oracle9i Database Release 2: 9.2.0.1–9.2.0.8 (patchset as of April 2007)
  •     Oracle Database 10g Release 1: 10.1.0.2–10.1.0.5 (patchset as of February 2006)
  •     Oracle Database 10g Release 2: 10.2.0.1–10.2.0.5 (patchset as of April 2010)
  •     Oracle Database 11g Release 1: 11.1.0.6–11.1.0.7 (patchset as of September 2008)
  •     Oracle Database 11g Release 2: 11.2.0.1–11.2.0.3 (patchset as of September 2011)
The version-numbering syntax within each release follows the pattern: major.maintenance.application-server.component-specific.platform-specific.

For example, "10.2.0.1 for 64-bit Solaris" means: 10th major version of Oracle, maintenance level 2, Oracle Application Server (OracleAS) 0, level 1 for Solaris 64-bit.

Over and above the different versions of the Oracle database management software developed over time, Oracle Corporation subdivides its product into varying "editions" - apparently for marketing and license-tracking reasons.

The Oracle Database Product Family

Oracle Database is available in five editions, each suitable for different development and deployment scenarios. Oracle also offers several database options, packs, and other products that enhance the capabilities of Oracle Database for specific application purposes. This section describes the Oracle Database editions. The database enhancement products are described in Chapter 2, "Options and Packs".


Oracle Database Standard Edition One. Oracle Database Standard Edition One delivers unprecedented ease of use, power, and performance for workgroup, department-level, and Web applications. From single-server environments for small business to highly distributed branch environments, Oracle Database Standard Edition One includes all the facilities necessary to build business-critical applications.

Oracle Database Standard Edition. Oracle Database Standard Edition delivers the unprecedented ease of use, power, and performance of Standard Edition One, with support for larger machines and clustering of services with Oracle Real Application Clusters (Oracle RAC). Oracle RAC is not included in the Standard Edition of releases prior to Oracle Database 10g, nor is it an available option with those earlier releases.

Oracle Database Enterprise Edition. Oracle Database Enterprise Edition provides the performance, availability, scalability, and security required for mission-critical applications such as high-volume online transaction processing (OLTP) applications, query-intensive data warehouses, and demanding Internet applications..

Oracle Database Express Edition.  Oracle Database Express Edition (Oracle Database XE) is an entry-level edition of Oracle Database that is quick to download, simple to install and manage, and is free to develop, deploy, and distribute. Oracle Database XE makes it easy to upgrade to the other editions of Oracle without costly and complex migrations. Oracle Database XE can be installed on any size machine with any number of CPUs, stores up to 4GB of user data, using up to 1GB of memory, and using only one CPU on the host machine. Support is provided by an online forum.


Oracle Database Personal Edition. Oracle Database Personal Edition supports single-user development and deployment environments that require full compatibility with Oracle Database Standard Edition One, Oracle Database Standard Edition, and Oracle Database Enterprise Edition.

Personal Edition includes all of the components that are included with Enterprise Edition, as well as all of the options that are available with Enterprise Edition, with the exception of the Oracle Real Application Clusters option, which cannot be used with Personal Edition. Personal Edition is available on Windows platforms only. The Management Packs are not included in Personal Edition.


Standalone tools

Users can develop their own applications in Java and PL/SQL using tools such as:
  •     Oracle JDeveloper
  •     Oracle Forms
  •     Oracle Reports
Oracle Certification Program

The Oracle Certification Program, a professional certification program, includes the administration of Oracle Databases as one of its main certification paths. It contains three levels:
  1.     Oracle Certified Associate (OCA)
  2.     Oracle Certified Professional (OCP)
  3.     Oracle Certified Master (OCM)
source: wikipedia & oracle


Use Case

A use case is a methodology used in system analysis to identify, clarify, and organize system requirements. The use case is made up of a set of possible sequences of interactions between systems and users in a particular environment and related to a particular goal. It consists of a group of elements (for example, classes and interfaces) that can be used together in a way that will have an effect larger than the sum of the separate elements combined. The use case should contain all system activities that have significance to the users. A use case can be thought of as a collection of possible scenarios related to a particular goal, indeed, the use case and goal are sometimes considered to be synonymous.
The Primary Use Case Notations
The Primary Use Case Notations
Actors

A use case defines the interactions between external actors and the system under consideration to accomplish a goal. Actors must be able to make decisions, but need not be human: "An actor might be a person, a company or organization, a computer program, or a computer system — hardware, software, or both."Actors are always stakeholders, but many stakeholders are not actors, since they "never interact directly with the system, even though they have the right to care how the system behaves." For example, "the owners of the system, the company's board of directors, and regulatory bodies such as the Internal Revenue Service and the Department of Insurance" could all be stakeholders but are unlikely to be actors. Actors are often working on behalf of someone else.

All actors must have names according to the assumed role. Examples of actor names (user roles):
  • Customer
  • Web Client
  • Student
  • Passenger
  • Payment System
Standard UML notation for actor is "stick man" icon with the name of the actor above or below of the icon. Actor names should follow the capitalization and punctuation guidelines for classes. The names of abstract actors should be shown in italics.
Student actor
Student actor
An actor may also be shown as a class rectangle with the standard keyword «actor», having usual notation for class compartments, if needed.
Customer actor as Class
Customer actor as Class
Relationships Between Actors
We can define abstract or concrete actors and specialize them using generalization relationship.
Generalization between actors is rendered as a solid directed line with a large arrowhead (same as for generalization between classes).
Web Client actor is abstract superclass for Administrator, Editor and Customer
Web Client actor is abstract superclass for Administrator, Editor and Customer

Associations Between Actors and Use Cases

Each use case specifies a unit of useful functionality that the subject provides to actors. This functionality should be initiated by an actor. Actors may be connected to use cases only by binary association relationship.
An association between an actor and a use case indicates that the actor and the use case communicate with each other.
An actor could be associated to one or several use cases.
Actor Customer associated with two use cases
When an actor has an association to a use case with a multiplicity that is greater than one at the use case end, it means that a given actor can be involved in multiple use cases of that type. The specific nature of this multiple involvement depends on the case on hand and is not defined in the UML 2.4 specification.

Thus, use case multiplicity could mean that an actor initiates multiple use cases:
  •     in parallel (concurrently), or
  •     at different points in time, or
  •     mutually exclusive in time.
Actor Bank is involved in multiple Use cases Transfer Funds.
When a use case has an association to an actor with a multiplicity that is greater than one at the actor end, it means that more than one actor instance is involved in initiating the use case. The manner in which multiple actors participate in the use case depends on the specific situation on hand and is not defined in the UML 2.4 specification.
For instance, actor's multiplicity could mean that:
  •     a particular use case might require simultaneous (concurrent) action by two separate actors (e.g., in launching a nuclear missile), or
  •     it might require complementary and successive actions by the actors (e.g., one actor starting something and the other one stopping it).
Two or more Player Actors are required to initiate Play Game Use case.
Two or more Player Actors are required to initiate Play Game Use case.
Use cases have no standard keywords or stereotypes. Use case could be shown with a custom stereotype above the name. As a classifier, use case has properties. A list of use case properties - operations and attributes - could be shown in a compartment within the use case oval below the use case name.
Use Case User Sign-In stereotyped as «authentication»
Use Case User Sign-In stereotyped as «authentication»
Use case with extension points may be listed in a compartment of the use case with the heading extension points.
Registration Use Case with extension points Registration Help and User Agreement
Registration Use Case with extension points Registration Help and User Agreement
A use case can also be shown using the standard rectangle notation for classifiers with an ellipse icon in the upper right-hand corner of the rectangle and with optional separate list compartments for its features.
Registration Use Case shown using the standard rectangle notation for classifiers
Registration Use Case shown using the standard rectangle notation for classifiers
The detailed behavior of a use case can be described by any means and techniques intended to define behaviors, in a separate diagram or textual document such as
  •     interactions,
  •     activities,
  •     state machines,
  •     pre- and post-conditions
  •     natural language text
Abstract Use Case
UML 2.4 does not mention, define or explain abstract use cases. UML 1.x specification mentioned that "the name of an abstract use case may be shown in italics" but since UML 2.0 this sentence was removed from UML specifications without any explanations. One reason that the sentence was removed could be that because use case is a classifier, and any classifier could be abstract (with the name shown in italics), it is obvious that it should be applicable to the use cases as well. An abstract use case is intended to be used by other use cases, e.g., as a target of generalization relationship.
Bank ATM Transaction use case becomes abstract use case
as a result of including Customer Authentication use case.
Relationships Between Use Cases
Use cases could be organized using following relationships:
  •     generalization
  •     association
  •     extend
  •     include
Extend Relationship
Extend is a directed relationship that specifies how and when the behavior defined in usually supplementary (optional) extending use case can be inserted into the behavior defined in the extended use case.
Extended use case is meaningful on its own, it is independent of the extending use case. Extending use case typically defines optional behavior that is not necessarily meaningful by itself. The extend relationship is owned by the extending use case. The same extending use case can extend more than one use case, and extending use case may itself be extended.
The extension takes place at one or more extension points defined in the extended use case.
Extend relationship is shown as a dashed line with an open arrowhead directed from the extending use case to the extended (base) use case. The arrow is labeled with the keyword «extend».
 
Registration use case is meaningful on its own.
It could be extended with optional Get Help On Registration use case
The condition of the extend relationship as well as the references to the extension points are optionally shown in a comment note attached to the corresponding extend relationship.
Registration use case is conditionally extended by Get Help On Registration
use case in extension point Registration Help
Extension Point
An extension point is a feature of a use case which identifies (references) a point in the behavior of the use case where that behavior can be extended by some other (extending) use case, as specified by extend relationship.
Extension points may be shown in a compartment of the use case oval symbol under the heading extension points. Each extension point must have a name, unique within a use case. Extension points are shown as a text string according to the syntax:
extension point ::= name [: explanation ]
The optional explanation is some description usually given as informal text. It could be in other forms, such as the name of a state in a state machine, an activity in an activity diagram, some precondition or postcondition.
Registration use case with extension points
Registration Help and User Agreement
Extension points may be shown in a compartment of the use case rectangle with ellipse icon under the heading extension points.

Extension points of the Registration use case,
shown using the rectangle notation
Include Relationship
An include relationship is a directed relationship between two use cases when required, not optional behavior of the included use case is inserted into the behavior of the including (base) use case. Including use case depends on the addition of the included use case.
Including use cases are usually not complete by themselves and require the included use cases. For whatever reasons, UML 2.4 does not refer to those as abstract use cases which seems very appropriate. Many other sources define abstract use case as including use case, while in fact it has to be expressed the other way around: including use case is abstract use case. See discussion of the definition of abstract use cases.
The include relationship could be used:
  •     when there are common parts of the behavior of two or more use cases,
  •     to simplify large use case by splitting it into several use cases.
Included use cases are required, not optional for the inclusion. Execution of the included use case is analogous to a subroutine call or macro command in programming. All of the behavior of the included use case is executed at a single location in the including use case before execution of the including use case is resumed.
Note, while UML 2.4 defines extension points for the extend relationship, there are no "inclusion points" to specify location or condition of inclusion for the include.
Include relationship between use cases is shown by a dashed arrow with an open arrowhead from the including (base) use case to the included (common part) use case. The arrow is labeled with the keyword «include».
When two or more use cases have some common behavior, this common part could be extracted into a separate use case to be included back by the use cases with include.

Both Deposit Funds and Withdraw Cash use cases
require (include) Customer Authentication use case.
Use Case Relationships Compared
In the Unified Modeling Language, the relationships between all (or a set of) the use cases and actors are represented in a Use Case Diagram or diagrams, originally based upon Ivar Jacobson's Objectory notation.

Benefits of Use Case Analysis

1. It helps manage very complex projects by breaking them down into different facets of development, thus focusing developers.
2. It allows developers to visualize outcomes before the documentation process, avoiding issues early on.
3. Allows for earlier testing.
4. allows problem modules to be removed or altered as needed without disrupting the overall project
5. It allows for input from all sides of the equation, from user-end on up.
6. Ultimately controls cost overruns.
7, Is standardized so it has wider implications and uses
8. It leaves documentation for later analysis
9. Flexibility- it can be as simple or complex as needed for its purpose.
10. It is reusable project-wide.

References: UML-diagram
www(dot) uml-diagrams(dot) org/use-case-diagrams-examples.html

Learn Data Modeling Part 2

Three basic Styles of data model:

Conceptual data models.  These models, sometimes called domain models, are typically used to explore domain concepts with project stakeholders.  On Agile teams high-level conceptual models are often created as part of your initial requirements envisioning efforts as they are used to explore the high-level static business structures and concepts.  On traditional teams conceptual data models are often created as the precursor to LDMs or as alternatives to LDMs.

Logical data models (LDMs).  LDMs are used to explore the domain concepts, and their relationships, of your problem domain.  This could be done for the scope of a single project or for your entire enterprise.  LDMs depict the logical entity types, typically referred to simply as entity types, the data attributes describing those entities, and the relationships between the entities. LDMs are rarely used on Agile projects although often are on traditional projects (where they rarely seem to add much value in practice).

Physical data models (PDMs).  PDMs are used to design the internal schema of a database, depicting the data tables, the data columns of those tables, and the relationships between the tables. PDMs often prove to be useful on both Agile and traditional projects and as a result the focus of this article is on physical modeling.

Although LDMs and PDMs sound very similar, and they in fact are, the level of detail that they model can be significantly different.  This is because the goals for each diagram is different – you can use an LDM to explore domain concepts with your stakeholders and the PDM to define your database design.

Figure 1. A simple logical data model.

Figure 2. A simple physical data model.

For example, figure above examine the relationship between Customer and Address there really should be two names “Each CUSTOMER may be located in one or more ADDRESSES” and “Each ADDRESS may be the site of one or more CUSTOMERS”.

What About Conceptual Models?

Halpin (2001) points out that many data professionals prefer to create an Object-Role Model (ORM), an example is depicted in Figure 3, instead of an LDM for a conceptual model.  The advantage is that the notation is very simple, something your project stakeholders can quickly grasp, although the disadvantage is that the models become large very quickly.  ORMs enable you to first explore actual data examples instead of simply jumping to a potentially incorrect abstraction – for example Figure 3 examines the relationship between customers and addresses in detail.
Figure 3. A simple Object-Role Model.


Common Data Modeling Notations:


Figure 4 above presents a summary of the syntax of four common data modeling notations: Information Engineering (IE), Barker, IDEF1X, and the Unified Modeling Language (UML).

source: datamodeling

Learn Data Modeling

Data modeling is the formalization and documentation of existing processes and events that occur during application software design and development. Data modeling techniques and tools capture and translate complex system designs into easily understood representations of the data flows and processes, creating a blueprint for construction and/or re-engineering. Data modeling in software engineering is the process of creating a data model for an information system by applying formal data modeling techniques.

A data model can be thought of as a diagram or flowchart that illustrates the relationships between data. Well-documented models allow stake-holders to identify errors and make changes before any programming code has been written.

Data modelers often use multiple models to view the same data and ensure that all processes, entities, relationships and data flows have been identified. There are several different approaches to data modeling, including:
  • Conceptual Data Modeling - identifies the highest-level relationships between different entities.
  • Enterprise Data Modeling - similar to conceptual data modeling, but addresses the unique requirements of a specific business.
  • Logical Data Modeling - illustrates the specific entities, attributes and relationships involved in a business function. Serves as the basis for the creation of the physical data model.
  • Physical Data Modeling - represents an application and database-specific implementation of a logical data model.
Data modeling is a process used to define and analyze data requirements needed to support the business processes within the scope of corresponding information systems in organizations. Therefore, the process of data modeling involves professional data modelers working closely with business stakeholders, as well as potential users of the information system. There are three different types of data models produced while progressing from requirements to the actual database to be used for the information system. The data requirements are initially recorded as a conceptual data model which is essentially a set of technology independent specifications about the data and is used to discuss initial requirements with the business stakeholders. The conceptual model is then translated into a logical data model, which documents structures of the data that can be implemented in databases. Implementation of one conceptual data model may require multiple logical data models. The last step in data modeling is transforming the logical data model to a physical data model that organizes the data into tables, and accounts for access, performance and storage details.
How data models deliver benefit
The Benefits of Data Modeling

Abstraction
  • The act of abstraction expresses a concept in its minimum, most universal set of properties. A well abstracted data model will be economical and flexible to maintain and enhance since it will utilize few symbols to represent a large body of design. If we can make a general design statement which is true for a broad class of situations, then we do not need to recode that point for each instance. We save repetitive labor; minimize multiple opportunities for human error; and enable broad scale, uniform change of behavior by making central changes to the abstract definition.
  • In data modeling, strong methodologies and tools provide several powerful techniques which support abstraction. For example, a symbolic relationship between entities need not specify details of foreign keys since they are merely a function of their relationship. Entity sub-types enable the model to reflect real world hierarchies with minimum notation. Automatic resolution of many-to-many relationships into the appropriate tables allows the modeler to focus on business meaning and solutions rather than technical implementation.
Transparency
  • Transparency is the property of being intuitively clear and understandable from any point of view. A good data model enables its designer to perceive truthfulness of design by presenting an understandable picture of inherently complex ideas. The data model can reveal inaccurate grouping of information (normalization of data items), incorrect relationships between objects (entities), and contrived attempts to force data into preconceived processing arrangements.
  • It is not sufficient for a data model to exists merely as a single global diagram with all content smashed into little boxes. To provide transparency a data model needs to enable examination in several dimensions and views: diagrams by functional area and by related data structures; lists of data structures by type and groupings; context-bound explosions of details within abstract symbols; data based queries into the data describing the model.
Effectiveness
  • An effective data model does the right job - the one for which it was commissioned - and does the job right - accurately, reliably, and economically. It is tuned to enable acceptable performance at an affordable operating cost.
  • To generate an effective data model the tools and techniques must not only capture a sound conceptual design but also translate into a workable physical database schema. At that level a number of implementation issues (e.g., reducing insert and update times; minimizing joins on retrieval without limiting access; simplifying access with views; enforcing referential integrity) which are implicit or ignored at the conceptual level must be addressed.
  • An effective data model is durable; that is it ensures that a system built on its foundation will meet unanticipated processing requirements for years to come. A durable data model is sufficiently complete that the system does not need constant reconstruction to accommodate new business requirements and processes.
  • Furthermore, as additional data structures are defined over time, an effective data model is easily maintained and adapted because it reflects permanent truths about the underlying subjects rather than temporary techniques for dealing with those subjects.
Data Modeling Process

The process of designing a database involves producing the previously described three types of schemas - conceptual, logical, and physical. The database design documented in these schemas are converted through a Data Definition Language, which can then be used to generate a database. A fully attributed data model contains detailed attributes (descriptions) for every entity within it. The term "database design" can describe many different parts of the design of an overall database system. Principally, and most correctly, it can be thought of as the logical design of the base data structures used to store the data. In the relational model these are the tables and views. In an object database the entities and relationships map directly to object classes and named relationships. However, the term "database design" could also be used to apply to the overall process of designing, not just the base data structures, but also the forms and queries used as part of the overall database application within the Database Management System or DBMS.

In the process, system interfaces account for 25% to 70% of the development and support costs of current systems. The primary reason for this cost is that these systems do not share a common data model. If data models are developed on a system by system basis, then not only is the same analysis repeated in overlapping areas, but further analysis must be performed to create the interfaces between them. Most systems within an organization contain the same basic data, redeveloped for a specific purpose. Therefore, an efficiently designed basic data model can minimize rework with minimal modifications for the purposes of different systems within the organization.
Data modeling in the context of Business Process Integration
Types of Data Models

A database model is a theory or specification describing how a database is structured and used. Several such models have been suggested. Common models include:
  • Flat model: This may not strictly qualify as a data model. The flat (or table) model consists of a single, two-dimensional array of data elements, where all members of a given column are assumed to be similar values, and all members of a row are assumed to be related to one another.
  • Hierarchical model: In this model data is organized into a tree-like structure, implying a single upward link in each record to describe the nesting, and a sort field to keep the records in a particular order in each same-level list.
  • Network model: This model organizes data using two fundamental constructs, called records and sets. Records contain fields, and sets define one-to-many relationships between records: one owner, many members.
  • Relational model: is a database model based on first-order predicate logic. Its core idea is to describe a database as a collection of predicates over a finite set of predicate variables, describing constraints on the possible values and combinations of values.
  • Object-relational model: Similar to a relational database model, but objects, classes and inheritance are directly supported in database schemas and in the query language.
  • Star schema is the simplest style of data warehouse schema. The star schema consists of a few "fact tables" (possibly only one, justifying the name) referencing any number of "dimension tables". The star schema is considered an important special case of the snowflake schema.
source: wikipedia

Comparison of data modeling tools

In general:

ToolCreatorTarget Business SizeLicenseSupported Database PlatformsSupported OSsStandalone or bundled into a larger toolkitLaunch Date
CA ERwin Data ModelerCA TechnologiesSMBs and enterprisesCommercial (Free, limited, community edition available)Access, IBM DB2, Informix, Ingres, MySQL, Oracle, Progress, MS SQL Server, Sybase, TeradataAll versions of WindowsStandalone1992?
Database Visual ArchitectVisual ParadigmSMBs and enterprisesCommercialIBM DB2, Firebird, Progress OpenEdge, Cache, MS SQL Server, MySQL, HSQLDB, SQLite, Oracle, PostgreSQL, SybaseWindows, Linux, MAC OSStandalone (or as part of an UML modeling environment)Unknown
dbConstructorDBDeveloper SolutionsSMBsCommercialOracle, MS SQL Server, MySQL, AccessAll versions of WindowsStandaloneUnknown
DbSchemaWise Coders SolutionsSMBsCommercialMySQL, PostgreSQL, MS SQL Server, Derby, Firebird, Oracle, IBM DB2, Informix, HSql, Pointbase, Mimer, Pervasive, SybaseAll versions of WindowsStandalone2005
DbWrench Database DesignNizana SystemsSMBsCommercialMS SQL Server, Oracle, PostgreSQL, MySQLWindows, Linux, MacStandalone2005
DeZign for DatabasesDatanamicSMBs and enterprisesCommercialMS SQL Server, MySQL, Oracle, IBM DB2, Firebird, InterBase, Informix, MS Access, SQLite, PostgreSQL, Sybase, ParadoxAll versions of WindowsStandalone1999
Enterprise ArchitectSparx SystemsSMBs and enterprisesCommercialIBM DB2, Firebird, InterBase, Informix, Ingres, Access, MS SQL Server, MySQL, SQLite, Oracle, PostgreSQL, SybaseWindows, Linux, MacData modeling is supported as part of a complete modeling platform.2000
ER/StudioEmbarcaderoSMBs and enterprisesCommercialAccess, IBM DB2, Informix, MySQL, Oracle, PostgreSQL, MS SQL ServerAll versions of WindowsStandalone1998
IBM InfoSphere Data ArchitectIBMEnterprisesCommercialIBM DB2, Informix, Oracle, Sybase, MS SQL Server, MySQL, TeradataLinux, WindowsStandaloneUnknown
MicroOLAP Databaser DesignerMicroOLAPSMBsCommercialMySQL, PostgreSQLAll versions of WindowsStandalone2003
MySQL WorkbenchMySQL (An Oracle Company)SMBs - personalCommercialMySQLLinux, Windows, MAC OSStandalone2006
Online Data ModelerJenaSoftSMBs - personalCommercialMS SQL Server, MySQL, PostgreSQL, Oracle, SQLite, MS AccessOnlineStandalone2011
Open ModelSphereGranditeSMBs - personalCommercial and free edition availableMS SQL Server, MySQLOnlinePart of modeling environment with UML support2010
Oracle SQL Developer Data ModelerOracleEnterprisesFreeOracle, MS SQL Server, IBM DB2Cross-platformStandaloneUnknown
PowerDesignerSybaseSMBs and enterprisesCommercialMS SQL Server, Oracle, PostgreSQL, MySQL, IBM DB2, InformixAll versions of WindowsStandalone1996
SQL Power ArchitectSQLPower SoftwareSMBsCommercial and free community editionPostgreSQL, Oracle, MS SQL ServerWindowsStandalone2004
Toad Data ModelerQuest SoftwareSMBs and enterprisesCommercial (Free, limited, community edition available)Access, IBM DB2, Informix, MySQL, Oracle, PostgreSQL, MS SQL ServerAll versions of WindowsStandalone2005 (before this date known as CaseStudio)
XCaseResolution Software LtdSMBs and enterprisesCommercialMS SQL Server, Oracle, PostgreSQL, MySQL, IBM DB2All versions of WindowsStandalone1996
ToolCreatorTarget Business SizeLicenseSupported Database PlatformsSupported OSsStandalone or bundled into a larger toolkitLaunch Date

Features:

ToolSupported data models (conceptual, logical, physical)Supported notationsForward engineeringReverse engineeringModel/database comparison and synchronizationTeamwork/repository
CA ERwin Data ModelerConceptual, logical, physicalIDEF1X, IE (Crows feet), and moreYesYesUpdate database and/or update modelWorkgroup edition provides collaboration
Database Visual ArchitectPhysicalCrows feetYesYesUpdate database and/or update modelAdditional product Teamwork Server for collaboration.
dbConstructorPhysicalCrows feetYesYesUpdate databaseNo
DbSchemaPhysicalCrows feetYesYesCompare to database and generate alter database script (update existing model not supported).No
DbWrench Database DesignPhysicalCrows feetYesYesUpdate database and/or update modelNo
DeZign for DatabasesLogical, physicalIDEF1X, IE (Crows feet)YesYesUpdate database and/or update modelNot directly. Merge functionality available.
Enterprise ArchitectConceptual, Logical & Physical + MDA transform of Logical to PhysicalIDEF1X, UML DDL, Information Engineering & ERDYesYesUpdate database and/or update modelMulti-user collaboration using File or DBMS Repositoty (or transfer via XMI, CVS/TFS or Difference Merge)
ER/StudioConceptual, logical, physicalIDEF1X, IE (Crows feet)YesYesUpdate database and/or update modelAdditional ER/Studio Repository for collaboration
IBM InfoSphere Data ArchitectConceptual, logical, physicalIDEF1X, IE (Crows feet), and moreYesYesUpdate database and/or update modelYes
MicroOLAP Databaser DesignerPhysicalCrows feetYesYesUpdate database with alter scriptsNo
MySQL WorkbenchPhysicalIE (Crows feet)YesYesUpdate database and/or update modelNo
NavicatConceptual, physicalIE (Crows feet)YesYesUpdate database and/or update modelNo
Online Data ModelerLogical, physicalIDEF1X (incomplete)YesYesUpdate database (update model unknown)Unknown
Open ModelSphereLogical, physicalIDEF1X, IE (Crows feet), and moreYesYesUpdate database and/or update modelNo
Oracle SQL Developer Data ModelerLogical, physicalIDEF1X, IE (Crows feet), and moreYesYesUpdate database and/or update modelUnknown
PowerDesignerConceptual, logical, physicalIDEF1X, IE (Crows feet), and moreYesYesUpdate database and/or update modelYes
SQL Power ArchitectPhysicalIDEF1X, IE (Crows feet), and moreYesYesCompare models and generate alter scriptNo
Toad Data ModelerLogical, physicalIDEF1X, IE (Crows feet), and moreYesYesUpdate database and/or update modelYes
XCasePhysicalIDEF1X, IE (Crows feet), and moreYesYesUpdate database and/or update modelNot directly. Merge functionality available.
ToolSupported data models (conceptual, logical, physical)Supported notationsForward engineeringReverse engineeringModel/database comparison and synchronizationTeamwork/repository

source: wikipedia