  Sentiment analysis on software engineering (SE) texts has been widely used in
the SE research, such as evaluating app reviews or analyzing developers
sentiments in commit messages. To better support the use of automated sentiment
analysis for SE tasks, researchers built an SE-domain-specified sentiment
dictionary to further improve the accuracy of the results. Unfortunately,
recent work reported that current mainstream tools for sentiment analysis still
cannot provide reliable results when analyzing the sentiments in SE texts. We
suggest that the reason for this situation is because the way of expressing
sentiments in SE texts is largely different from the way in social network or
movie comments. In this paper, we propose to improve sentiment analysis in SE
texts by using sentence structures, a different perspective from building a
domain dictionary. Specifically, we use sentence structures to first identify
whether the author is expressing her sentiment in a given clause of an SE text,
and to further adjust the calculation of sentiments which are confirmed in the
clause. An empirical evaluation based on four different datasets shows that our
approach can outperform two dictionary-based baseline approaches, and is more
generalizable compared to a learning-based baseline approach.
