
What Is Sentiment Analysis?
Sentiment analysis takes large volumes of data and uses natural language processing (NLP) to determine whether a body of text has a positive, negative, or neutral sentiment.
There are three main approaches to sentiment analysis:
- Rules-based techniques: A group of words (lexicons) are classified in terms of tone. For example, a positive lexicon might include “secure” and “compliant,” while a negative lexicon might contain “insecure” and “non-compliant.”
- Machine learning (ML)-based techniques: These techniques use algorithms trained to determine sentiment based on words appearing in blocks of text and the order in which they appear. The ML learns and improves as more data is ingested.
- Hybrid techniques: This combines rules-based and ML approaches to balance speed and accuracy based on the use case.
In a talk by Perforce Principal Software Engineer Alex Celeste at Embedded World, Celeste introduced the concept of static sentiment analysis, which combines sentiment analysis and static analysis.
What Is Static Sentiment Analysis?
Static sentiment analysis takes the concept of sentiment analysis and combines it with static analysis. Static sentiment analysis uses machine learning (a small-language model) to analyze code and determine developer intent.
In other words, static sentiment analysis could determine whether the code does what a developer meant for it to do.
As artificial intelligence and machine learning technologies advance, they can help automate the software development process by adding a new dimension to testing and save development teams time and effort.
More on Static Sentiment Analysis
Explore how static sentiment analysis works, its benefits, and how static sentiment analysis complements static analysis best practices in our new eBook.
Challenges of Traditional Testing in Software Development
Traditional software testing isn’t enough in today’s complex digital landscape, especially with the introduction of AI and ML.
Manual testing and manual code reviews slow down the development cycle and introduce a higher risk of human error. Currently, teams using static analysis tools — like Perforce Helix QAC and Klocwork — are automating the process by detecting bugs, code vulnerabilities, and compliance issues early in development.
But while traditional techniques like static analysis perform well against “hard” criteria like syntax errors, buffer overflows, and quantifiable rules in coding standards, they can miss “soft” criteria like developer intent. That’s where static sentiment analysis comes in.
Developers may soon be able to bridge the gap between intent and implementation by taking a static sentiment analysis approach.
How Does Static Sentiment Analysis Work?
Static sentiment analysis analyzes an abstract representation of code to determine if a test section is significantly different from a reference sample in the same code base. These differences could be changes in a developer’s style, code clarity, or misapplied design patterns.
A successful static sentiment analysis would not just detect the pattern of the structure — it would need to identify instances where the test section is sufficiently different from a reference sample and raise a flag.
To break it down further, static sentiment analysis determines the mathematical distance between the entropy of a test feature and a reference sample. The distance measures the similarity between features, and entropy evaluates the feature’s information. A significant increase in the distance between features indicates an unexpected change in style, which may require further investigation.
How Static Analysis and Machine Learning Level Up DevOps Workflows
The promise of static sentiment analysis allows developers to identify where developer intent went amiss in code and better fulfill the needs of customers and industry standards.
While static sentiment analysis is still in the research phase, static analysis is currently helping DevOps teams shift left and increase developer productivity.
Static code analyzers Helix QAC and Klocwork help reduce technical debt by:
- Finding and fixing coding issues earlier
- Improving overall software quality
- Quickly inspecting millions of lines of source code (legacy and new code)
- Enforcing coding standards compliance
- Prioritizing risk and analysis results.
With the introduction of static sentiment analysis, DevOps teams could even further level up their workflows by also automatically checking for instances where developer intent may have been missed — greatly reducing the time and effort required for exhaustive functional testing.
In the meantime, there’s a lot you can do to level up now. See for yourself how Perforce Static Analysis helps accelerate development. Sign up for your free 7-day trial today.
About Perforce
The best run DevOps teams in the world choose Perforce. Perforce products are purpose-built to develop, build and maintain high-stakes applications. Companies can finally manage complexity, achieve speed without compromise, improve security and compliance, and run their DevOps toolchains with full integrity. With a global footprint spanning more than 80 countries and including over 75% of the Fortune 100, Perforce is trusted by the world’s leading brands to deliver solutions to even the toughest challenges. Accelerate technology delivery, with no shortcuts.
About Version 2 Digital
Version 2 Digital is one of the most dynamic IT companies in Asia. The company distributes a wide range of IT products across various areas including cyber security, cloud, data protection, end points, infrastructures, system monitoring, storage, networking, business productivity and communication products.
Through an extensive network of channels, point of sales, resellers, and partnership companies, Version 2 offers quality products and services which are highly acclaimed in the market. Its customers cover a wide spectrum which include Global 1000 enterprises, regional listed companies, different vertical industries, public utilities, Government, a vast number of successful SMEs, and consumers in various Asian cities.

