Goal Oriented Requirements Engineering for Blockchain based Food Supply Chain

– Blockchain technology is the buzz word in the industry and research fields and it is considered to be a disruptive technology. Every organization that interacts with agents and intermediaries for getting their business processes are trying to bring Blockchain in their business for the efficiency, security and trust it can bring. The world has started experimenting with blockchain


INTRODUCTION
Early requirements analysis of a system helps in understanding the requirements clearly and identifying the conflicts that may arise at early stages. A comprehensive requirements analysis leads to better design, good quality product in lower cost and time because of lesser needs of rework. With new innovative technologies emerging continuously as we make our way to Industry 4.0, we are witnessing a disruption of Blockchain technologies. Blockchain is essentially a data structure, where each block represents a transaction that is cryptographically chained in chronological order and allows the resulting ledger to be accessed by different servers [1]. This means that historical transactions cannot be deleted or altered without tampering with the structure of blockchain. Blockchain technology is based on Smart contracts which are self-enforcing agreements, which are rendered in the form of a software program that implements the contract [2]. Blockchain, in essence is a shared distributed ledger with smart contracts to enable the business in a trustworthy manner. Blockchain is the core technology behind the popular bitcoin, but it has been quickly realized that this technology is capable of transforming any business [3]. Many organizations are venturing into blockchain like food industry, supply chain, authentication, events management and e-commerce. The distributed ledgers are based on a protocol agreed by all the nodes which determines the 'true state' of the ledger at any point of time. When this protocol is applied the nodes are said to achieving consensus. Distributed ledgers working involves users at a node commencing a transaction using their digital signatures and then broadcasting it to all the other nodes or participants. Then as per the permissions, one or more nodes start validating the transaction. This leads to creation of a block that creates a validated transaction, which is again broadcasted to all the nodes. A consensus protocol is used to agree upon the current state which is a true state represented in the block. The block is then appended to previous block, forming a blockchain. Blockchain composes of multiple such validated blocks residing on the shared network and linked cryptographically using the hash functions. The use of network security tools like digital signatures, private/public keys, proof of work is done at various points of implementation of blockchain. The lack of central authority controlling all the transactions helps in creating a network that is based on trust among peers [4]. Certain processes still require a regulatory body to be present in the blockchain for Quality Assurance purposes, but these parties also come in as a participant in the network. Blockchains are generally used to transfer value or assets from one participant to another which is initiated by a participant or a smart contract. Smart contracts are selfenforcing agreements, which are rendered in the form of a software program that executes the terms of the contract [1]. These transfer of values or assets aka transactions are recorded in the blockchain which are difficult to alter and any rules or rights involved in the transaction are evidently available to all the participants. Whether this blockchain technology is suitable or not needs to be assessed because implementation of these systems require a complete overhaul of the existing business processes [5]. The business organization needs to reinvent itself as adopting it might also involve reconfiguration and a lot of human effort. The business processes need to be organized efficiently at a greater scale and this can only be possible if notion of decentralization and its essence can be adopted by the organization itself and its underlying structure.
ABSTRACT -Blockchain technology is the buzz word in the industry and research fields and it is considered to be a disruptive technology. Every organization that interacts with agents and intermediaries for getting their business processes are trying to bring Blockchain in their business for the efficiency, security and trust it can bring. The world has started experimenting with blockchain but there are still a lot of basic issues that need attention as the technology is relatively new. The standards and practices for implementing this new technology are not yet in place which impede its full acceptance despite being useful. Blockchain applications have specific concerns like non-repudiation, data privacy, immutable transactions etc. which should be addressed for the implementation of technology. Goal oriented Requirements Engineering is a popular technique that helps in understanding business goals in a comprehensive manner. As a first step towards formalizing the requirements analysis, this paper focuses on identifying the goals and softgoals for blockchain enabled systems. Specifically, a case study on blockchain enabled food supply chain has been explored for identifying the goals and softgoals. These goals can then be used by software engineers or practitioners for requirements specification and system design. journal.ump.edu.my/ijsecs ◄ This paper focuses on one of the crucial initial steps required to create any application i.e. early requirements analysis. For an effective requirements analysis, Goal Oriented Requirements Engineering is proposed as a technique to capture the business goals, expectations and conflicts can be captured comprehensively earlier rather than later in the development of this system. The following section gives a description of Goal Oriented Requirements Engineering technique and introduces the concept of goals and softgoals. Then, the basic features of blockchain are discussed and the implementation challenges are presented. The next section proposes the goals and softgoals that may be relevant to a blockchain around food provenance. The papers concludes with importance of this contribution and planned future work on requirements analysis of blockchain based systems.

GOAL ORIENTED REQUIREMENTS ENGINEERING
Requirements engineering (RE) refers to the activities that are aimed at guaranteeing that a software system accomplishes the goals, the wants and the expectations of all the appropriate stakeholders [6]. If poor requirements are identified, it augments the jeopardy of losing the opportunity of achieving customers' needs and enhancing the user experience. Goal oriented requirements engineering basically focusing on satisfying business needs. A goal is an objective that should be achieved by the system. Goals include multiple concerns: functional concerns are related with the services to be given, and nonfunctional concerns are allied with quality of servicesuch as efficiency, safety, security, accuracy, user friendliness, and so forth. Specially, for business application systems, Goals may be used to link up the new software to organizational and business contexts [7]. Several classifications of Goals have been proposed in the literature. Functional goals or just goals trigger the services that the software is expected to perform whereas non-functional goals or softgoals refer to expected qualities of software and constraints such as performance, security, safety, usability, flexibility, customizability, interoperability and so forth [8]. Softgoals are therefore special kind of goals that do not have a precise criterion for their fulfilment. Softgoals represent the abstract, vaguely defined and high level objectives of stakeholders. For example, some softgoals of the commercial department of an electronic music store might be: upsurge market share, please the customer, deliver a user friendly interaction, and keep a large variety [8]. While satisfying a goal implies conversion of a goal into an functioning procedure, satisficing a goal suggests the vagueness of the relationship goal-requirement, and points out the risk of doing a strategic decision that might contribute to achieving an objective. Softgoals are satisfied when there is sufficient positive evidence for their satisfaction; otherwise, they are not satisfied. In presence of conflicting evidence for the satisfaction of a goal, the decision involves negotiation with the stakeholders. A popular goal and scenario based standard called, User Requirements Notation [9] has been adopted for many applications like web applications [10], Business processes [11] and is a potential proposed solution for early requirements analysis of blockchain systems in this paper.
As per author's knowledge URN [9] is the lone standard that syndicates goals and scenarios in one notation. It is a combination of two notations GRL (Goal Requirements Language) and UCM (Use Case Maps). URN is based on i* Framework [12] and NFR Framework [13]. URN has been focussed on modelling goals and justifying the decision rationale that finally form a system and assist in modeling dynamic systems that can adapt at run time. URN includes two notations-GRL & UCM. GRL is Goal Requirements Language that is mainly focussed on detailed analysis of functional goals as well as soft-goals.. UCM means Use Case Maps provides a visual notation for different use-case scenarios that help to illustrate contributory relationships among responsibilities.  Figure 1. GRL notation contributes to goal analysis in multiple ways as they help in expressing ambiguous goals, detailed analysis and break down of goals and softgoals, provide measurable non functional requirements, providing a tracing mechanism of a specific requirement to a business goal, avail conflict resolution from multiple stakeholders and prioritization of requirements. GRL integrates the treatment of functional and non-functional requirements while associating system requirements to goals that can be well understood by stakeholders. The GRL notation also has provision to depict the goals in detail with journal.ump.edu.my/ijsecs ◄ the help of scenarios i.e. UCM diagrams. For any such goal or task that needs to be analysed through scenarios can be linked with the Use Case Maps using a URN link. The URN link indicates the goal has been depicted with UCM notation as a walkthrough.
Use Case Maps (UCM) are used to depict scenarios that can assist in visualization of operational requirements and their association with functional requirements. This is different to Activity Diagrams provided in UML as UCM support dynamic modification at the functional and structural level. Furthermore, it offers a combined view of scenarios over alternative paths that promotes reasoning and decision making on high level architecture of the system. UCM notation involves equences of responsibilities (X's) corresponding to activities, tasks or functions perform by a system, and inclined on paths (curved lines) that describe the causation movements in maps. Responsibilities can be attached with components, that form the functional or logical entities. Scenarios progress through paths from start points (filled circle) to end points (bars). Different levels of details can also be depicted by using a stub (diamond) that can include sub-maps. The UCM syntax also includes constructs for alternative and parallel processing. The UCM notation is shown in Figure  2 as described in the standard that tries to bridge the gap between the requirements and architectural modelling.

Figure 2. Use Case Maps notation subset
URN combines two notations, developed separately, that provide integrated information about functional and nonfunctional requirements and enable their traceability throughout the life cycle of application development. Though we can use GRL and UCM separately, the real advantage is when both are used concurrently which allows discovery and refinement of requirements through goals and depicting their realization into architectural models through scenarios. When compared to workflow absed business process generation for architectural design [14], UCM provides a holistic view when used along with GRL. It is important that the system under consideration should be understood completely before any requirements analysis method can be applied for its creation. The next section describes key features of blockchain system that will be then be interpreted from requirements perspective.

BLOCKCHAIN BASED FOOD SUPPLY CHAIN
With the rapid digitization happening, the organizations come across disruptive technologies that can entirely transform their way of operations in business. This sub-section discusses the key features of blockchain based systems.

Blockchain
Blockchain at its core is a linked-list based implementation that offers append only operations, is cryptographically linked to other blocks using a hash pointer that refers to the preceding block and establishing a chain. The hash pointer holds the address of the preceding block in addition to hash of data stored in the preceding block as shown in the Figure  3 given below. Simply stated, this data structure mainly has two components: -• Blocks are the records of transactions that are cryptographically secured. • Transactions are the activities carried out by the participants of the blockchain system This structure of blockchain forms the basis of the blockchain based system which we call as a distributed shared ledger that is cryptographically secured and offers manipulation of assets/ values in append only form by any participant without the need of central authorization. A blockchain system offers following key features according to Dorri, Kanhere & Jurdak [15]. journal.ump.edu.my/ijsecs ◄

Immutability
Immutable according to Merriam Webster dictionary means 'not capable of or susceptible to change'. Construction of immutable ledgers is one of the main contributions of blockchain. This means a transaction once agreed on, and recorded in a block can never be changed. Each and every change is appended and if there is tampering with even a single block also, the cryptographic hashing reflects the changes in the entire blockchain.

Decentralization
A decentralized ledger ensures scalability, efficiency, robustness, prevents forced trust on a central control system or authority. The participating nodes use their own resources which decreases only one-way traffic flow of information. This therefore, decreases the latency and overcomes the disadvantage of centralized model where failure of one single node causes failure in the system.

Anonymity
On a blockchain based system, anonymity is guarded and personal identity of participants involved is not relevant. Trust is built because of the robustness of the blockchain system and immutability. It conforms to personal data protection and is an effective way of masking the identity of participants.

Enhanced Security
Blockchain provides better security because all the information is not lying on a single node and thus attack on one doesn't uncover entire data. The participant nodes, transactions, blocks are all secured by various cryptographic techniques like digital signatures, public/private keys, hashing and encryption algorithms.

Consensus
A block is created when the transactions are validated by trusted participants. The blockchain is updated via the consensus protocol that safeguards a common, clear collation of blocks and assures the integrity and reliability of the blockchain across geographically distributed nodes [16]. This protocol enables new blocks to be appended to the existing blockchain after consensus has been received from all participants.

Provenance
Append-only process in the transactions is called hash chaining. This process creates a tamperproof audit trail that allows participants of all information about the asset beginning from its first ownership and changes that happen later. This in turn creates provenance, which means that all the transactions can be traced back and information regarding them can be retrieved in the network.

Increased Capacity
The distributed nature of the blockchain system offers scalability as the flow of traffic is not towards one single node. There are certain challenges pertaining to the amount of data each block handles because of the redundancy but blockchains are usually highly scalable. journal.ump.edu.my/ijsecs ◄

Redundancy
Whenever a new transaction is done, all the previous transactions are replicated that causes redundancy. In order to verify the transactions, each transaction is processed by every node independently for the same result. In case of centralized databases, transactions are processed once.

Finality
When a transaction is implemented through a smart contract and added to the blocks, the ownership of asset or any other changes are executed immediately according to the contract conditions. This way the finality of a transaction is achieved instantaneously. If an flawed transaction is directed, withdrawing it would require an equivalent transaction in the reverse direction, while maintaining visibility of both transactions.
The above key features of blockchain make it a very good technology for businesses where trust is required and role of intermediaries can be reduced. When a blockchain based system is developed these features of blockchain form part of the functional as well as non-functional requirements of the system. Any business organization deciding to venture into blockchain based systems needs a detailed understanding of these features and how they will be translated into their business processes. Understanding of the system requirements of blockchain and also of business problem domain are important for integration and application of the technology in the business.
Every block and transaction on the distributed ledger is encrypted and there needs to be a process ensuring that everything on the shared network is cryptographically encoded. The blockchain based supply chain should enable provenance as the main feature of blockchain is append only transactions which enables to trace back to the origin of the transaction. This is a very useful feature to enhance trust and transparency.
Whether it's a new supply chain or existing supply chain, considering adoption of Blockchain requires a thorough understanding of the requirements of the system. It has been emphasized by researchers and practitioners that deciding precisely what to build is the toughest part of constructing a software system as nothing else cripples the system if done wrongly than this conceptual part. When new technologies emerge, it becomes even more crucial to understand the requirements of the system covering both functional and non-functional aspects. The functional requirements focus on the operational part of the software system and can reasonably be easily conceptualized and implemented. Whereas, nonfunctional requirements are constraints of the system that are used to adjudge the system [17]. Non-functional requirements also refer to quality attributes that stakeholders consider as a must characteristics and these are also interpreted as constraints on the structural aspects of the software design. Thus, the success/failure of software systems is largely dependent on .satisfaction of non-functional requirement. To generate systematic and structured requirements analysis model, it is vital to identify the functional and nonfunctional requirements of blockchain based systems.
As discussed in previous section, Goal oriented requirements engineering enables comprehensive analysis by helping understand business objectives better. Proposed approach advocates use of goals and scenarios for understanding the business goals, resolving conflicts and considering the alternatives. When that has been done, the goals can then get translated to functional requirements and the softgoals to non-functional requirements.
When a blockchain based system is developed the following processes need to be executed [18]: 1. Every new transaction data is added to a block and shared with all the nodes. 2. Each node in the blockchain gathers new transaction data and prepares for processing. 3. New blocks are processed with high priority on an urgent basis. 4. The transaction data is validated by authorization and checking its semantic correctness by each node. 5. Merkle tree data structure is used for adding new nodes wherein hashing is also used extensively to find the location of the new addition. 6. When hash process is completed, the information about new block is shared with all other nodes. 7. Result of hashing is verified by all the other nodes so that the transaction data is formally correct, authorized and semantically correct. 8. Each node maintains their own replica of the blockchain-data-structure where valid new node is appended. 9. A new block, if invalid is discarded and other new blocks are added in same fashion.
The following section underlines the basic concepts of food supply chain taken as a case study for this paper. Specifically, the problem of food provenance in the supply chain is considered in the next section and possibility of blockchain based solution is explored.

Food Supply Chain
Food supply chain involves many participants beginning from the suppliers or the farmers to the distributors and retailers before it reaches the end consumer. There are multliple intermediate stages that contribute in the creation, production, packaging, delivery, and sales of the product (Figure 4). Although there are regulatory bodies and government departments that enforce policies for food safety by conducting inspections and certifications of quality, this may not be trusted for multi-continent distributions. For example, United States withdrew meat imports from Brazil in June 2017 as they found out that food inspectors in Brazil were corruupt, there was a horse meat scandal in Europe in 2013, the 2008 baby milk powder scandal in China, and the rising food adulteration problem in India. Many such incidents have been reported over the past decade, which is worrisome. This has led to consumers and governments call for more transparency on what happens to the food from the origin till it reaches them.
It is very hard to track the origin of the ingredients in processed food products. The information like manufacturer, production date, batch and even the equipment used are important for regulatory bodies and consumers who like to be informed what is offered to them. Provenance means "source or origin; or, the history of ownership of a valued object or work of art or literature" according to Merriam-Webster Dictionary. Food Supply Chain Management aims to ensure the transparency and visibility of information among different stakeholders such as producers, purchasers, distribution centers and customers. The stakeholders of food supply chain include Food producers, processors or manufacturers, distributors, end consumers, Government and regulatory agencies, logistic companies and financial organizations [19] Blockchain based system can be a solution to food provenance as the technology is designed support provenance of each and every ingredient used in the processed foods. This will enable all participants to have access to any information regarding the production process or in general end to end information. This has various benefits like increased trust as there is no authority owning the provenance, improved system utilization, lower cost in long term and specific recalls rather than across the batches. The next section attempts to identify goals and softgoals that will capture the needs of a blockchain based food supply chain and models goals and scenarios using URN.

USER REQUIREMENTS NOTATION FOR BLOCKCHAIN BASED FOOD SUPPLY CHAIN
Food supply chain as explained in the previous section involves multiple stakeholders and intermediaries. The generic problems in food supply chain like provenance, efficiency, trust can possibly be solved by blockchain technology. Figure  5 shows a hypothetical food supply chain based on blockchain that could ensure end to end provenance. Starting from the food source/ field, the raw food is provided a 'certificate of origin; with information like batch number, date etc. by a government body which is then shared with a processing facility. Any transaction of food product or transfer of place requires a smart contract which governs the rules and checklist followed in the transaction with update to the blockchain about any change that happens with the food product. All changes are recorded in the blockchain and governed by smart contracts when food is processed, packaged, transported, tested, distributed and finally consumed. The consumers have full access to the entire food supply chain which brings in trust, transparency and efficiency in the food supply chain business. journal.ump.edu.my/ijsecs ◄  Figure 5, they can be developed into the system using Goal oriented Requirements Engineering (GORE), whose merits have been discussed in the previous sections. The functionalities or functional requirements can be depicted as Goals of a blockchain based system. Each functionality is also related with the qualitative requirements that are depicted as softgoals in GORE. The softgoals related with each functional goal are correspondingly shown in brackets. Some of the softgoals that are translated to non-functional requirements are described below.

Traceability
The International Standards Organization of standards (ISO 9001: 2000) defines traceability as "the ability to trace the history, application, or location of an entity using recorded identifications". Traceability in blockchain based network utilizes the features of append-only transactions and a shared ledger. This enables all relevant participants to be able to trace the origin to destination journey. journal.ump.edu.my/ijsecs ◄

Interoperability
According to ISO/IEC 25000 standards [20], inter-operability is a the extent to which a software can helpfully function with others. Supply chain requires point-to-point integration among stakeholders such as producers, processors, traders, distributors and consumers to access and manipulate the information related to supply chain of a food product. Thus, interoperability among different entities of food supply chain can be achieved by adopting blockchain due its distributed nature.

Scalability
A network that can increase its capacity in terms of data, transaction or number of participants without compromising its performance and efficiency it is said to be scalable. There is always a trade-off between the size and time based performance.

Integrity
Integrity is the level of accuracy and authenticity of the data maintained by the software system.

Confidentiality
Confidentiality is the degree to which data sensitivity and authorization is protected by the software system.

Latency
When the business process extends beyond the predefined time, and lags, it is said to have high latency. A threshold needs to be decided for the permissible lag as the verification of transaction by trusted party should be within the limits of allowed latency. Though this can be assumes as a functional requirement, latency can be taken as a constraint for the product to ensure all qualitative assurance procedures are met.

Accessibility
Blockchain network must be accessible to all the participants in the distributed network.

Performance
Whenever a new transaction is appended in the blockchain supply chain, full ledger is presented which degrades the performance. Thus a decision has to be taken about which portion of data has to be part of ledge and which portion can be excluded in order to achieve the stable performance.
With the identified softgoals and goals in blockchain based food supply chain, now the interest is to find their assignment in the system. Food supply chain is a complex set of transactions from field to the table involving multiple stakeholders. User Requirements Notation can be used for early requirements analysis depicting both goals and scenarios. In this paper, food processing stage is illustrated in URN diagrams as representing the entire food supply chain with the URN can't be done in the paper. Figure 6 illustrates some of the goals, subgoals, tasks and softgoals through a GRL diagram of blockchain based food processing. The generic goals and softgoals for food processing are shown with white background, and blockchain specific goals and softgoals are depicted in color. Three stakeholders/ actors are identified at this stage: Food Processor, Distributor, Regulatory authority.
When the food processor, processes food item which is its generic business process, it has to add a transaction governed by a smart contract. The transaction has to be validated by other stakeholders through a blockchain process (depicted in form of tasks and goals) and then it can be added to the ledger. The functionalities / goals pertaining to blockchain system also have corresponding softgoals that ensure the quality and integrity of the blockchain system. For example, 'add transaction' goal has softgoal 'latency' attached to it that has to ensure no delay in execution of the goal. Goals and softgoals have weighted influence on each other in a positive manner or a negative manner as many of the processes are linked to one another in blockchain based supply chain.
Similar to food processor, regulatory authority shall have goals, subgoals and softgoals pertaining to both the food supply chain and blockchain system. The diagram can be refined further to explore more subgoals and finer details of the business processes. In fact, the way the relationships between different goals, softgoals and stakeholders are captured in GRL diagram with weighted affinities or antipathies, they can be used to consider design alternatives and resolve conflicts. This feature can also be used to justify if the system or a particular business process really needs a blockchain solution [5]. journal.ump.edu.my/ijsecs ◄ Figure 6. Enhanced GRL diagram depicting food processing stage.
Parallel to the GRL diagram, UCM diagram help in modeling scenarios. This helps in generation of architecture in a much detailed way where the workflow is described in relation with the goals. Figure 7 shows the scenario where food processor requests to add the transactions and other parties endorse the transaction which may or may not be verified. In case of not verified it is still added to the ledger but the world status is not changed. The figure her shows one segment of the scenario. Similarly, all possible scenarios with different alternatives can be modeled using UCM and walkthroughs of the system can be envisaged. This enables business owner to visualize the goals, softgoals and scenarios and see which of his requirements are met or not met. There can also be trade-offs between two or more goals or softgoals which can further be explored in the Use Case Maps. Use of GRL and UCM diagrams, collectively URN help in prioritizing requirements, choosing alternatives, finding completeness of requirements, envisioning the scenarios and resolving any conflicts earlier rather than later in software development. GORE has various benefits, especially with the novel technologies where there is not much clarity on what journal.ump.edu.my/ijsecs ◄ can be the impact of its incorporation into existing business processes. The business process management of supply chain and integration of blockchain technology in it has been attempted in research [22] (Mendling et. al, 2018).This is a conceptual contribution on how GORE can be used to include blockchain in food supply chain.

CONCLUSION
This paper has contributed in conceptualization of a blockchain based food supply chain system. Food Supply chain systems are crucial systems that can benefit a lot with implementation of blockchain due to the efficiency, in-time delivery, trust, lowered costs and provenance. Besides the specific case study, the goals and softgoals for blockchain based systems have been identified and described. With lack of any standard practices, URN standard helps in the requirements analysis of these systems. This will lay a foundation of a thorough requirements analysis process. Goal oriented requirements engineering helps in deciding better alternatives, resolving conflicts and reasoning about the business goals of an organization. For requirements analysis of blockchain systems, future work involves comparing GORE approach with other requirements engineering approaches. After this step, design of these blockchain based systems, can be prepared. However, further work is needed for seamless transition to design phase which can then lead to standard practices in developing blockchain based systems.