# Getting Started with Quality Assurance in APEX Project Eye (APE)

## Introduction

One of the wonderful things about Oracle APEX is that all the metadata of our applications is stored in the database and accessible through the APEX dictionary views. It would almost be a crime to avoid taking advantage of this for all sorts of possibilities.

We all follow coding guidelines or organizational policies to keep our solutions secure, consistent, and easy to maintain. Or at least we **should** follow them, but we all know this is only sometimes the case, especially in larger teams.

With APEX applications, it’s a walk in the park to validate if our standards are followed just by writing simple queries on the dictionary views.

## Writing Quality Rules

Let’s take one commonly known security measure to prevent broken authentication in your application: Protecting your pages with authorization schemes.

If you want to check which pages are not protected with authorization schemes, you can just run this simple SQL statement:

```sql
select *
  from apex_application_pages
 where authorization_scheme is null
```

When looking at the results, we realize that it makes no sense to include publicly accessible pages like our login page, and also, page 0 cannot be protected with an authorization scheme. In the end, our statement should look something like this:

```sql
select *
  from apex_application_pages
 where authorization_scheme is null
   and page_id != 0
   and page_requires_authentication = 'Yes'
```

And this is how to get a list of all our pages that could cause an unnecessary security risk, so we fix them one by one. Easy right? But of course, it doesn't stop here. We could query to see if all our SAVE buttons are labelled and formatted consistently throughout the application if naming conventions are being followed, and all sorts of best practice guidelines.

## Creating Quality Rules and Standards in APE

Not all developers are familiar with the APEX Dictionary views, and the library can be overwhelming. Also, running SQL statements one by one is time-consuming, so we want to validate our application code with a Quality Assurance framework that makes our lives even easier.

APEX Project Eye (APE) is one of a handful of available tools which can comprehensively support your Quality Assurance management.

With the Rule Builder Wizard, anyone who does not know all properties by heart can easily browse through the APEX dictionary views and get a preview of the most common values in their metadata to help find the correct attribute.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673179859106/fc72324c-b550-497a-a5c8-73d4a467f9f8.png align="left")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673179819345/7156f0d5-9bc9-4a4f-8329-51310c8e9967.png align="center")

The Rule Builder generates the SQL statement for you with the component key attribute, which is the only required field for APE Quality rules:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180261212/5a709d3f-16e5-4bcc-991c-55a06df97c38.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180164176/41fec316-2edb-4271-8664-2a867d9c99a5.png align="center")

Each rule can and should be described with its own metadata, giving the QA practitioner vital information about the rule, its justification, and steps to resolve the issue.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180278007/04eda9e1-f125-4870-a60a-6484147a97e4.png align="center")

Quality rules are listed in Quality Standards, which represent your organizational guidelines, with a severity level for each rule defining how significant a violation of that rule is for you and your organization. And in case you lack some inspiration, APEX Project Eye delivers over 40 prebuilt rules included in the UNITED CODES Way of Working Quality Standards, which you can use or copy as templates. 

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180288059/dc63d6b4-eafc-44f4-8b98-2394a7e3c8f6.png align="center")

## Running Quality Assessments

Before running Quality Assessments, you need to define where the Assessments should be run and which Standards should be assessed. APE offers the following scope levels:

* Workspace
    
* Application
    
* Page Group
    
* Page
    
* Database Schema
    

It’s also possible to combine multiple scope levels:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180295881/42a2c148-02fb-44bb-80a9-44165c60b100.png align="center")

After that, you're ready to roll! Sit back, relax, and wait for your assessment to finish.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180654204/cb36cbe7-e4ae-4884-bf29-65fdbf2fba24.png align="center")

## Browsing Through the Assessment Results

When the assessment is finalized, you'll need to navigate a vast sea of found issues. APE helps you by offering three different browsing angles: By Rules, By Components, or By Severity:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180629920/cd2fc0e7-a094-481d-8a3f-5a11e42ff67c.png align="center")

And here are your issues waiting for you to analyze them and react as you see appropriate. You can mark the issue as an exception to exclude it from this and future assessments or immediately resolve it by clicking the Fix button, which takes you directly to the component in the APEX Page Designer.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673180696901/4041a452-a5cb-47b7-a3aa-b418c030769e.png align="center")

## Conclusion

Designing and aligning internally in your team which guidelines must be followed, can require quite some time and patience. But with a Quality Management Framework, it’s simple to implement and make QA Assessments part of your development lifecycle. 

## Useful links

[APEX Project Eye](https://www.apexprojecteye.com/)

%[https://www.youtube.com/watch?v=ZY4UkqDTIDQ&t=14s]
